CSS and layers

liunx

Guest
Hallo there,
I created a layer with Dreamweaver. It looks like:

<div id="pLayer" style="position:absolute; width:400px; height:15px; z-index:1; background-color:#E52324; layer-background-color:#E52324; color:white; border: 1px none #000000; left: 10px; top: 120px">tada</div>

Styles are set inside the div tag. Is it possible to put them in a linked stylesheet? Something like:

.pLayer
{
position:absolute;
width:400px;
height:15px;
z-index:1;
background-color:#E52324;
layer-background-color:#E52324;
color:white;
border: 1px none #000000;
}

And do the positioning attributes (left and top) stay inside the div tag, or can they also be moved to the stylesheet?


Thanks!
SjefYes, you can do that, and yes, you can move all style definitions (including positioning) to external styles.What syntax should I then use for the positioning:
top: 100px;
left: 200px;

??You can set the positioning relative to the top, right, bottom, or left. You can also specify the type of positioning as static, relative, absolute, fixed, inherit . You may be interested in <!-- m --><a class="postlink" href="http://www.w3.org/TR/CSS2/visuren.html#positioning-scheme">http://www.w3.org/TR/CSS2/visuren.html# ... ing-scheme</a><!-- m -->
 
Back
Top