Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 8th, 2009, 01:53 AM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default Applying css positioning to li

i am using the <li> tag in my user control to list a few asp:LinkButtons.

they are under the following CSS rules:

Code:
 
li
{
position:absolute;
left:-15px;
}
li:hover
{
position:absolute;
left:+15px;
}
 
my issue is that all the links show on top of one another. not one below the other...

my code looks like this:

Code:
 
<ul>
  <li><asp:LinkButton ...Properties... /></li>
  <li><asp:LinkButton ...Properties... /> </li>
</ul>
the properties are the id, runat, and text, (no actual link to another page quite yet...)
 
Old March 8th, 2009, 02:12 AM
Friend of Wrox
 
Join Date: Mar 2008
Posts: 133
Thanks: 15
Thanked 1 Time in 1 Post
Send a message via ICQ to iceman90289 Send a message via AIM to iceman90289
Default

ok wow... i used absolute positioning... i wanted relative... okay this issue was just caused by my ignorance...

it looks great now.
 
Old March 8th, 2009, 06:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Since I wrote this before I saw you had already figured it out, I post it anyway. Maybe it can help you figure out how it works. It's often good to try things out on a very simple page instead of the actual markup you want to use it for. Makes one see the wood for all the trees.

-------------------------------------------------------------------------

Quote:
my issue is that all the links show on top of one another. not one below the other...
Yes, that's what you would get of you position them the in the same place. A box that's positioned absolute is taken out of the normal document flow, It takes up now space. You could say that it's "layered" on top of other content.

Create some colored boxes and play with them. Something like this.

Code:
#foo               { width: 300px; height: 140px; background: yellow }
#bar               { width: 400px; height: 160px; background: red }
#baz               { width: 500px; height: 180px; background: blue }
Code:
<div id="foo"></div>
<div id="bar"></div>
<div id="baz"></div>
Make one box at the time 'position: absolute' (without offset), then two at the time, then all three. Add offset, z-index and so on and change those properties around until you understand what they do. Read the spec and try the things you read about out on your boxes.
http://www.w3.org/TR/CSS2/visuren.html
Especially:
http://www.w3.org/TR/CSS2/visuren.html#positioning-scheme
http://www.w3.org/TR/CSS2/visuren.html#q30


That said, there's probably no reason to use 'position: absolute' at all for your list items.
__________________
--
http://yupapa.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS for fixed width li and right aligned text echovue CSS Cascading Style Sheets 2 March 12th, 2007 02:21 PM
Applying CSS to tables andyhague CSS Cascading Style Sheets 4 April 5th, 2006 05:30 AM
Pure CSS Positioning Prob socoolbrewster CSS Cascading Style Sheets 4 September 7th, 2005 08:01 AM
Applying CSS to a disabled List Box in ASP.net imsuneeta ASP.NET 1.0 and 1.1 Basics 1 May 2nd, 2005 08:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.