I've learned CSS, well just a couple of hours ago with the tutorials at w3schools.com and i have one question
I want to have my logo/banner displayed on every page of my website, so i did this in my ***.css file:
body
{
background-image:url('logo.gif');
background-repeat:no-repeat;
background-attachment:fixed;
}
and i link all of my pages to this css file, i figured since all html codes have body so i'll have my logo on all my pages problem solved.
However,1 major problem. When i start inserting my contents into these pages, the content overlaps the logo. The words start from the top of the page, overlapping my logo. So i thought i could do this:
p
{
margin-top:150px;
}
since the height of my logo is 150pixels, this makes sure all my content starts after 150.
But here comes another problem, whenever i use the <p> tag, it always leaves a top margin of 150. How do i make d rest of my content to display relative to this 150 border? First question.
Second question, what is div? how do i use it? it wasn't covered in the w3school tutorial, or maybe i didnt understand it.
Third question, how do i insert my menu links on the left of every page the same way as my banners in css?Try:body
{
background-image:url('logo.gif');
background-repeat:no-repeat;
background-attachment:fixed;
margin-top:150px;
}
A div is a block level element with no sematic value, that way you can use it for anything providing a better element doesn't exist. Alot of people use them as containers for the site or to split up their menu/sidebar from their main content.That worked! But i'm a little confused. By adding margin-top:150px shouldn't the margin be at the top of my logo.gif? Like this
How about my 3rd question?how do i insert my links in my .css file so that it can be displayed on all my pages?You can't insert HTML into a CSS file. You want to have the same HTML on all pages?
Server Side Includes (<!-- m --><a class="postlink" href="http://webdevfaqs.com/php.php#include">http://webdevfaqs.com/php.php#include</a><!-- m -->)Thx mstrbob..i guess i cant run away for server side scripting
I want to have my logo/banner displayed on every page of my website, so i did this in my ***.css file:
body
{
background-image:url('logo.gif');
background-repeat:no-repeat;
background-attachment:fixed;
}
and i link all of my pages to this css file, i figured since all html codes have body so i'll have my logo on all my pages problem solved.
However,1 major problem. When i start inserting my contents into these pages, the content overlaps the logo. The words start from the top of the page, overlapping my logo. So i thought i could do this:
p
{
margin-top:150px;
}
since the height of my logo is 150pixels, this makes sure all my content starts after 150.
But here comes another problem, whenever i use the <p> tag, it always leaves a top margin of 150. How do i make d rest of my content to display relative to this 150 border? First question.
Second question, what is div? how do i use it? it wasn't covered in the w3school tutorial, or maybe i didnt understand it.
Third question, how do i insert my menu links on the left of every page the same way as my banners in css?Try:body
{
background-image:url('logo.gif');
background-repeat:no-repeat;
background-attachment:fixed;
margin-top:150px;
}
A div is a block level element with no sematic value, that way you can use it for anything providing a better element doesn't exist. Alot of people use them as containers for the site or to split up their menu/sidebar from their main content.That worked! But i'm a little confused. By adding margin-top:150px shouldn't the margin be at the top of my logo.gif? Like this
How about my 3rd question?how do i insert my links in my .css file so that it can be displayed on all my pages?You can't insert HTML into a CSS file. You want to have the same HTML on all pages?
Server Side Includes (<!-- m --><a class="postlink" href="http://webdevfaqs.com/php.php#include">http://webdevfaqs.com/php.php#include</a><!-- m -->)Thx mstrbob..i guess i cant run away for server side scripting