Jump to content

CSS Questions?


liamloveslearning

Recommended Posts

Hey everyone

I recently read I should be using CSS to control the look of my site and that I should be giving everything a class of its own, rather than using tables and <font... etc.

 

I apologize in asvance if this is a stupid question but

 

whats the best way of applying the styles to a page, as im using tables and inline styles etc, where I feel i should be using the css files to modify the look?

 

so what goes into the style sheet and what stays in the page? whats the best practice? Would it be to build my page format free then give everything a style?

 

sorry if this is a really confusing question but yeah; whats best practice?

 

Thanks

 

 

Link to comment
Share on other sites

So many questions!

 

Lol, well yes, in this day and age, all sites design 'should' be controlled using CSS.

Tableless designs are the way to go 'IMO' (and most others opinion).

 

Basically, text (size, color etc), headings, the structure of the design, background, colors, lists, etc should all be controlled using CSS. So this way you can change the design by altering 1 page rather then hundreds.

Link to comment
Share on other sites

In general, you want to have element properties defined in a css file if the manipulated item appears on more than 1 page. If there's a certain table or whatever that you're modifying that will only appear on that one page, it's not a big deal to directly modify the tag with the style="" . Anything else though should be in a something.css file that is included in the head tags.

 

As for how to setup a page, you need to think of your page as sections. Like use phpfreaks for example, you'd have the header section(where the logo is). then you have the gray bar section that says "hello username" and the date. etc etc and then you make div tags for each. Then back in your something.css file you'd have stuff like #header { background:url('image.jpg'); height:value;} and so on. So a quick layout of phpfreaks would be

 

<div id="header">
   
</div>
<div id="greeting">
  Welcome username <span>date</span>
</div>
<div id="forum_info">
  links and stuff
</div>

so on and so on

Link to comment
Share on other sites

And as for table-based layouts... BAD! Tables don't display until everything in them has been loaded. When you go to myspace, you will notice that heavy profiles take a while to show even though the background and header links show up right away. That's bc the header and main content are 2 main tables that control all of the content. using div tags to layout everything show as they are loaded(plus are wayyy easier to quickly modify with your something.css file)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.