4 replies [Last post]
Tvup
Offline
newbie
Last seen: 2 years 48 weeks ago
Timezone: GMT+1
Joined: 2011-11-04
Posts: 3
Points: 4

Hi!

Im not much of a frontend programmer, and i've stumbled across a small question, but i guess with multiple solutions. Some of those greater than others, but im very unsure on what the really intention with CSS and html-documents is...

A good strategy when making a website must be to devide the code for layout and content. To make it simple let's say that i have a website without dynamic content. I know that the site should contain some blocks with text, some kind of navigation-bar, a header with logo etc, and a footer with some contact-info or whatever.

I would use the

tag in my html-file and name each section. I keep the html-file clean of style properties, so if the file were viewed without an attached css-style, it would show a boring black and white page with fonts in the same size and such - maybe some pictures as well.

When i attach a css schema i can make a nice layout. Then the site would look much nicer.

I guess that's the intention of dividing into html and css.

Some day i might find a nice layout and get permission to use that one by the author. I would then simply take the css-file and overwrite my existing one. Then i'll run into problems. He or she might have used different names for the sections. The question is: How should i handle this?

Editing the html-file doesn't seem like the obvious soloution since im not changing any of the content. Changing the css-file might be the way. I could run into some other problems that e.g. he/she expected the sections like <div id="footer-wrapper"><div id="footer">SOMETHINGHERE</div></div> and i didn't have the wrapper.

It seems like i miss some connection between the html-file and the css-file.

How do i deal with that? Should i have some DOM to map between the html-file and the css? And do you have some good examples of that?

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 hour 53 min ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5125
Points: 2722

Hi Tvup, This how to should

Hi Tvup,
This how to should help explain things, IDs, Classes and Elements explained

Tvup
Offline
newbie
Last seen: 2 years 48 weeks ago
Timezone: GMT+1
Joined: 2011-11-04
Posts: 3
Points: 4

Thank you. It's a fine

Thank you. It's a fine description of the differences between ids and classes. But that's not what im seeking. My mayor issue is to deal with different style-sheets for the same page when the classes/ids are named differently.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 2 weeks 4 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2037
Points: 2259

Tvup wrote: Thank you. It's a

Tvup wrote:

Thank you. It's a fine description of the differences between ids and classes. But that's not what im seeking. My mayor issue is to deal with different style-sheets for the same page when the classes/ids are named differently.

Why would you have different style sheets for the same page? Class and ID names are how they are targeted so naming them differently doesn't work.

There is a conceptual error here that I can't pinpoint so why not head over to http://htmldog.com and go through the tutorials? Do them in order.

Tvup
Offline
newbie
Last seen: 2 years 48 weeks ago
Timezone: GMT+1
Joined: 2011-11-04
Posts: 3
Points: 4

Nvm, it seems like im not

Nvm, it seems like im not able to explain the issue.
I'll find some frontend programmers to bother instead.