|
| |
|
|
FlowerPower
Posts: 67 Joined: 4/27/2004 Status: offline
|
_position or position? - 7/13/2005 2:49:56
I found some css code online and have adapted it to a site I am constructing, and it all seems to work fine. However, it contains the following lines, which I am a bit unsure about: _position: relative; _top: -50%; Is there a difference between _position and position? Thanks!
|
|
|
|
FlowerPower
Posts: 67 Joined: 4/27/2004 Status: offline
|
RE: _position or position? - 7/13/2005 7:27:07
Sorry, I found it in the stylesheet for http://www.jakpsatweb.cz/css/priklady/vertical-align-final-solution-en.html, which explains a way to achieve vertical centering using css. I thought it looked strange, and when I removed the underscore it did make a difference but I couldn't quite figure out what was going on. Thanks for the help! By the way, if anyone knows of a simpler/better/more elegant way to achieve the vertical centering in css, I would love to know. I'm relatively new to css - that is, I can read the code and figure out most of it, but have trouble constructing it all, and designing the hierarchy (the cascading part).
|
|
|
|
FlowerPower
Posts: 67 Joined: 4/27/2004 Status: offline
|
RE: _position or position? - 7/13/2005 11:20:53
Thank you very much. I will experiment. I was a bit confused by the triple nesting of divs, but I'll tinker and see if I can make some sense of it.
|
|
|
|
c1sissy
Posts: 5084 Joined: 7/20/2002 From: NJ Status: offline
|
RE: _position or position? - 7/13/2005 11:49:55
quote:
I was a bit confused by the triple nesting of divs, Just a note to help you out here, when you do the divs, make sure you comment their opening and closing. ANd it needs to be done a certain way, or it will cause bugs within IE.
<div id="container"><!--open container div-->
your content goes in here.......
<!--close container div--></div> Make sure that when you comment the closing div, that your comment is on the inside of the closing div. This makes searching your code much easier, plus it helps you to find the divs when you need to either mess with the code while playing or when you are designing a page, it helps with finding it to change content.
_____________________________
Deb-aka-c4Ksissy high panjandurum and alpha female of the silverback tribe As decreed by Jesper 5-24-2003. The only stupid question is... the one that is never asked!! http://directory.css-styling.com http://fmsforum.com http://positioniseverything.net/ http://www.tanfa.co.uk/
|
|
|
|
FlowerPower
Posts: 67 Joined: 4/27/2004 Status: offline
|
RE: _position or position? - 7/13/2005 12:04:11
Thanks for the very useful hints. In this case, though, the problem is not so much keeping track of what I've done, but understanding what I've done in the first place. I'm unsure why there were three layers of nested divs to center the text (in the the code on the page I mentioned above): in the page I'm working on, I want a navigation bar bang smack in the middle of the page, extending the full width of the page and always staying vertically centered. I have got it to work fine using a modified version of the code I found, and have tested it in Firefox and IE and it works well. But I may very well have created very ugly code and made it unnecessarily complicated. Anyway, I guess that's part of the learning process. Thanks for your patient replies!
|
|
|
|
c1sissy
Posts: 5084 Joined: 7/20/2002 From: NJ Status: offline
|
RE: _position or position? - 7/13/2005 12:20:55
quote:
I'm unsure why there were three layers of nested divs to center the text Ok, one reason why it is good to comment your code. it would make it easier to understand their layout. Nested divs help with your layout. A container div (sometimes called a wrapper div) will do just that, contain things, and make your design easier to do, and get to work in different browsers. A container is great for floats, just make sure you use a clearing method in the container div. A good article to look up is the Aslett clearning method.
_____________________________
Deb-aka-c4Ksissy high panjandurum and alpha female of the silverback tribe As decreed by Jesper 5-24-2003. The only stupid question is... the one that is never asked!! http://directory.css-styling.com http://fmsforum.com http://positioniseverything.net/ http://www.tanfa.co.uk/
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|