npsychd
10-15-2013, 07:48 PM
hi all, I am a newbie to CSS and learning through sample templates posted on web..currently i am looking for an answer on one of the template i am going through..its html page goes on like this...
<body>
<div id="header-wrapper">
<div id="header" class="container">
<div id="logo">
<h1><a href="#">Hyacinth</a></h1>
<span>Template Design by <a href="http://www.freecsstemplates.org/" rel="nofollow">FreeCSSTemplates.org</a></span> </div>
<div id="menu">
<ul>
<li class="current_page_item"><a href="#" accesskey="1" title="">Homepage</a></li>
<li><a href="#" accesskey="2" title="">Our Clients</a></li>
<li><a href="#" accesskey="3" title="">About Us</a></li>
<li><a href="#" accesskey="4" title="">Careers</a></li>
<li><a href="#" accesskey="5" title="">Contact Us</a></li>
</ul>
</div>
</div>
</div>
the css part of the file goes as follows...
#header-wrapper
{
overflow: hidden;
padding: 5em 0em;
}
#header
{
}
.container
{
margin: 0px auto;
width: 1200px;
}
#logo
{
padding: 5em 0em;
text-align: center;
}
#logo h1
{
font-size: 3.5em;
}
#logo a
{
text-decoration: none;
color: #FFF;
}
#logo span
{
letter-spacing: 0.10em;
text-transform: uppercase;
font-size: 0.90em;
color: rgba(255,255,255,0.5);
}
#logo span a
{
color: rgba(255,255,255,0.8);
}
#menu
{
}
#menu ul
{
text-align: center;
}
#menu li
{
display: inline-block;
}
#menu li a, #menu li span
{
display: inline-block;
margin-left: 0.50em;
padding: 1em 1.5em;
letter-spacing: 0.20em;
text-decoration: none;
font-size: 0.90em;
font-weight: 600;
text-transform: uppercase;
outline: 0;
color: #FFF;
}
#menu .current_page_item a
{
background: #67128F;
border-radius: 8px;
color: #FFF;
}
Question on html code:
1. from the above code, apart from the div id="header-wrapper" why is it that another div="header" declared and why isnt "container" class declared inside div id="header-wrapper"? Is it a good practise to declare the class="container" along with the id="header-wrapper"? if so then why do u think the coder coded it this way?
2. inside the span element there is a hyper link attribute in which there is a property called rel="nofollow" , what does this mean?
question on css code:
1. what does 'em' stands for padding attribute? is this the best practise of doing it or in pixels?
2. under logo span a: color is declared as rgba(255,255,255,0.8); why is it done like this when the color looks similar to grey?
3. under #menu .current_page_item a: border-radius is given as 8px, now what does this mean?
Please help me with these queries...Thanks!
<body>
<div id="header-wrapper">
<div id="header" class="container">
<div id="logo">
<h1><a href="#">Hyacinth</a></h1>
<span>Template Design by <a href="http://www.freecsstemplates.org/" rel="nofollow">FreeCSSTemplates.org</a></span> </div>
<div id="menu">
<ul>
<li class="current_page_item"><a href="#" accesskey="1" title="">Homepage</a></li>
<li><a href="#" accesskey="2" title="">Our Clients</a></li>
<li><a href="#" accesskey="3" title="">About Us</a></li>
<li><a href="#" accesskey="4" title="">Careers</a></li>
<li><a href="#" accesskey="5" title="">Contact Us</a></li>
</ul>
</div>
</div>
</div>
the css part of the file goes as follows...
#header-wrapper
{
overflow: hidden;
padding: 5em 0em;
}
#header
{
}
.container
{
margin: 0px auto;
width: 1200px;
}
#logo
{
padding: 5em 0em;
text-align: center;
}
#logo h1
{
font-size: 3.5em;
}
#logo a
{
text-decoration: none;
color: #FFF;
}
#logo span
{
letter-spacing: 0.10em;
text-transform: uppercase;
font-size: 0.90em;
color: rgba(255,255,255,0.5);
}
#logo span a
{
color: rgba(255,255,255,0.8);
}
#menu
{
}
#menu ul
{
text-align: center;
}
#menu li
{
display: inline-block;
}
#menu li a, #menu li span
{
display: inline-block;
margin-left: 0.50em;
padding: 1em 1.5em;
letter-spacing: 0.20em;
text-decoration: none;
font-size: 0.90em;
font-weight: 600;
text-transform: uppercase;
outline: 0;
color: #FFF;
}
#menu .current_page_item a
{
background: #67128F;
border-radius: 8px;
color: #FFF;
}
Question on html code:
1. from the above code, apart from the div id="header-wrapper" why is it that another div="header" declared and why isnt "container" class declared inside div id="header-wrapper"? Is it a good practise to declare the class="container" along with the id="header-wrapper"? if so then why do u think the coder coded it this way?
2. inside the span element there is a hyper link attribute in which there is a property called rel="nofollow" , what does this mean?
question on css code:
1. what does 'em' stands for padding attribute? is this the best practise of doing it or in pixels?
2. under logo span a: color is declared as rgba(255,255,255,0.8); why is it done like this when the color looks similar to grey?
3. under #menu .current_page_item a: border-radius is given as 8px, now what does this mean?
Please help me with these queries...Thanks!