liamloveslearning Posted June 23, 2008 Share Posted June 23, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/111454-css-questions/ Share on other sites More sharing options...
josephman1988 Posted June 23, 2008 Share Posted June 23, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/111454-css-questions/#findComment-572354 Share on other sites More sharing options...
dannyb785 Posted June 23, 2008 Share Posted June 23, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/111454-css-questions/#findComment-572398 Share on other sites More sharing options...
dannyb785 Posted June 23, 2008 Share Posted June 23, 2008 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) Quote Link to comment https://forums.phpfreaks.com/topic/111454-css-questions/#findComment-572401 Share on other sites More sharing options...
TheFilmGod Posted June 23, 2008 Share Posted June 23, 2008 You should use external styling through the use of classes / ids. Use proper markup tags as well. Such as <h1><h2>, <p> and <ul><li>. Steer away from overusing divs. HTML markup is just the content. Fancy pantsy looks come from the CSS file. Quote Link to comment https://forums.phpfreaks.com/topic/111454-css-questions/#findComment-572617 Share on other sites More sharing options...
dbrimlow Posted June 24, 2008 Share Posted June 24, 2008 So many of us have been where you are (and are groaing at the task you have ahead of you). It comes down to learning. Two crucial must buy books: Eric Myers on CSS, and Bulletproof Web Design by Dan Cederholm Quote Link to comment https://forums.phpfreaks.com/topic/111454-css-questions/#findComment-573610 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.