Home CSS
CSS Unordered list Print E-mail
Sunday, 22 August 2010 08:08

CSS for formatting an unordered list UL as a menu. Adding 'position: relative;' is needed to display the list properly in Firefox and Chrome.

ul.menu, ul {
position: relative;
margin: 0;
padding: 0;
margin-top: 4px;
font-size: 12px;
list-style-position: outside;
list-style-image: none;
list-style-type: none;
}
ul.menu li, li {
margin:0;
padding: 0;
line-height: 18px;
}
 
CSS Centre Print E-mail
Sunday, 22 August 2010 08:08

Centre the internetpage with CSS:

.holder
{
width: 200px;
height: 100px;
text-align: center;
min-width: 100px; /* Width of the wrapper, this prevents problems in Netscape
background-color:#60F; /* blue */
}
.wrapper
{
margin: 0 auto; /* important to get it working correct in Firefox en Chrome
width: 100px;
height: 100px;
text-align: left;
background-color:#FF0; /* yellow */
}

<div class="holder">
<div class="wrapper">
hello
</div>
</div>

hello

 

(The text-align CSS of the 'holder'-class can also be attached to the body tag)

 
CSS Centre with negative margin Print E-mail
Sunday, 22 August 2010 08:08

Centre the internet page with CSS, '.wrapper' holds the CSS centre code:

.holder
{
position: relative;
min-width: 100px;
width: 200px;
height: 100px;
background-color:#60F; /* blue */
}
.wrapper
{
position: relative;
width: 100px;
height: 100px;
left: 50%;
margin-left: -50px;
background-color:#FF0; /* yellow */
}

<div class="holder">
<div class="wrapper">
hello
</div>
</div>

hello
 
CSS voor IE6 Print E-mail
Sunday, 22 August 2010 08:08

After the loading of the standaard all-browser CSS, you can put the following code to the HTML to load IE6(ieonly.css) CSS:

<!--[if lte IE 6]>
<link href="/CSS/ieonly.css" rel="stylesheet" type="text/css" />
<![endif]-->
 
CSS FILES Print E-mail
Sunday, 22 August 2010 08:08

Question: Is it good to use more than one CSS file for a layout? For example: template.css, position.css, and layout.css print.css.

Answer: If a CSS file is very large, it can be hard to edit. It is better to split a large file in separate files. On the other hand, be careful with the use of multiple files.It can be difficult to put the code in the correct file. The fact that CSS style sheets overlap, can get finding bad or dubble markup code very cumbersome.

Useful tools in recovering the formatting code in the CSS file are the following browser extensions: Firebug for Firefox and IE developer toolbar for IE

 


 

Mobielstartpagina.nl

Visit our mobile portal page:

http://www.mobielstartpagina.nl

or

http://www.mobielstartpagina.nl/iPhone

on your smartphone!

Tech news and updates by PCWorld. Focused on computers and consumer electronics, topics include computer hardware, software, wireless, digital entertainment, security and anti-virus and gadgets.