which is the best way to do this CSS?

This is a discussion on "which is the best way to do this CSS?" within the Web Page Design section. This forum, and the thread "which is the best way to do this CSS? are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Aug 20th, 2008, 19:13
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 159
Thanks: 3
Thanked 2 Times in 2 Posts
which is the best way to do this CSS?

I was wondering, I use external Style sheets to set font color, background and link color's, but on my main page I have used CSS to base of the template.

When you as a deisnger create a new page do you put the stuff eg #header or the other bits of CSS that make the boxes in an external style sheet or just copy and paste it onto a new page when you create it.

Also this is the code I have at the moment on my main page:

Code: Select all
<!DOCTYPE html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
#header {
    margin: 0 auto;
    width:800px;
    height:123px;
    border:#000000 thin solid;
}
#wrapper {
    margin: 0 auto;
    width:800px;
    height:500px;
    padding: 10px 0 0 0;
    border:#000000 thin solid;
}
#footer {
    margin: 0 auto;
    width:800px;
    height:30px;
    border:#000000 thin solid;
}
#left {
    float:left;
    width:200px;
    height:250px;
    border:#000000 thin solid;
}
#main {
    float:right;
    width: 590px;
    height:250px;        
}
-->
</style>
</head>

<body>
<div id="header">Content</div>
<div id="wrapper">
<div id="left">Content</div>
<div id="main">Content</div>


</div>
<div id="footer">Content</div>
</body>
</html>
If was to take out all of the CSS on that page and put it into an external style sheet, would i still be able to use <div id="header"> on the page or wouldn't it work because the CSS is located in an external style sheet?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Aug 20th, 2008, 19:18
saltedm8's Avatar
SuperMember

SuperMember
Join Date: Nov 2005
Location: here
Age: 27
Posts: 1,524
Blog Entries: 2
Thanks: 1
Thanked 11 Times in 11 Posts
Re: which is the best way to do this CSS?

always separate everything... you can put all the css into one css sheet if you wanted
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Aug 20th, 2008, 19:31
welshstew's Avatar
Site Admin

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,889
Blog Entries: 14
Thanks: 9
Thanked 39 Times in 37 Posts
Re: which is the best way to do this CSS?

Quote:
Originally Posted by Stormraven View Post
If was to take out all of the CSS on that page and put it into an external style sheet, would i still be able to use <div id="header"> on the page or wouldn't it work because the CSS is located in an external style sheet?
yes you would, just make sure you reference it correctly, as per the first external style sheet you have
__________________
WelshStew Site Admin
If you think I've helped, click the "Thanks"
xtreme wales - extreme clothing
WebForumz - facebook | LinkedIn [/size]
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Aug 20th, 2008, 19:34
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 159
Thanks: 3
Thanked 2 Times in 2 Posts
Re: which is the best way to do this CSS?

So even though though the CSS is in .css styleshet the div tags will still work? The mysteries of CSS

What do you mean by 'as per the first external style sheet you have'?

Last edited by Stormraven; Aug 20th, 2008 at 19:35. Reason: missed welshstew's post :(
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Aug 20th, 2008, 19:52
welshstew's Avatar
Site Admin

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,889
Blog Entries: 14
Thanks: 9
Thanked 39 Times in 37 Posts
Re: which is the best way to do this CSS?

as per this line:
Code: Select all
<link href="style.css" rel="stylesheet" type="text/css" />
that style sheet is external. in your directory, the same one as your web page, you should have a file named "style.css"
__________________
WelshStew Site Admin
If you think I've helped, click the "Thanks"
xtreme wales - extreme clothing
WebForumz - facebook | LinkedIn [/size]
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Aug 20th, 2008, 20:14
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 159
Thanks: 3
Thanked 2 Times in 2 Posts
Re: which is the best way to do this CSS?

Ahhh thankyou very much to the both of you for your help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved