Two questions about CSS!

admin

Administrator
Staff member
Hi! I have two questions concerning CSS...<br />
<br />
1) What does the CSS attribute z-index stand for?<br />
<br />
2) How do I align images using CSS? (Like instead of <img align="right">)<br />
<br />
Thanks in advance!<!--content-->1. havnt got a clue what z-index actually stands for?<br />
<br />
2.you can float an image left, center, right<br />
absolute, relative position it<br />
<br />
position:absolute;left:10px;top:10px;<br />
positions it relative to the entire page, ie 10px down from top and 10px from left of page<br />
<br />
position:relative;left:10px;top:10px;<br />
positions it an image where it would statically be positioned<br />
<br />
<br />
google gives you quite a few tut's to choose from (<!-- m --><a class="postlink" href="http://www.google.com/search?sourceid=navclient&q=css+positioning">http://www.google.com/search?sourceid=n ... ositioning</a><!-- m -->)<!--content-->1- me neither! But I've seen it mentioned lots of times.<br />
<br />
2- I guessed that. Sometimes I feel that CSS makes things a lot more complicated.<br />
<br />
But thanks leoo!<!--content-->what do you mean "stand for"?<br />
<br />
z as in the z-axis... index as in the defining feature... right?<!--content-->doh, i was completely trying to think if 'z' actually stood for something, ofcourse it's the z-axis cos in css we position things in 3 dimensions!:D<!--content-->Normally, people think of web design in two dimensions, so they only think about the x- and y-axis:<br />
<br />
^<br />
y |<br />
|<br />
|<br />
|<br />
|<br />
-----------------------><br />
| x<br />
|<br />
|<br />
|<br />
|<br />
<br />
This works for most designs. Sometimes, though, you need to deal with the third dimension. It is hard to draw, but imaging a line coming straight out of the screen at you. That is the z-axis. The z-index, then, defines where on the z-axis an element should go. Element A with a z-index of 2 will be further out on the z-axis than element B with a z-index of 1, so A will effectively be on top of B. This allows for overlapping of elements, like having text on top of a picture.<br />
<br />
y|<br />
|<br />
|<br />
|________<br />
/ x <br />
/<br />
/z<!--content-->Originally posted by agent002 <br />
2 Sometimes I feel that CSS makes things a lot more complicated.<br />
<br />
<br />
yeah css has the tendency to do that,it's worth it in the long run though i actually learnt css before any other type of layout, when i came across tables i thought someone was kidding with me :P<!--content-->Originally posted by leoo24 <br />
yeah css has the tendency to do that,it's worth it in the long run though i actually learnt css before any other type of layout, when i came across tables i thought someone was kidding with me :P Seriously???<!--content-->css can make things alot more complicated when i got into it i was like this is pointless but it is so easy now when it comes to tables, as for doing it with images, i dont really see the need it is easier to adjust those in the <> tags and yes the zindex is exactly that they use it in all kinds of stuf especially video games<!--content-->Originally posted by entimp <br />
Seriously??? <br />
lol, yup, i started learning by disecting wysiwyg output (as many people do)but i chose a spanish one that to my luck used css layout, so that's what i learnt and as far as i knew was the only way to do it! Until i saw some post somewhere about someone's table layout messing up! :D<!--content-->Ok, thank you for your answers, they made things clear for me.<br />
I've self-learnt HTML (and CSS) and JavaScript, so there may be some black holes in my knowledge. :)<!--content-->
 
Back
Top