473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

could LI element be just 1px height ?

when I use LI tag as a separator like a line in UL tag

<ul>
<li>line1 </li>
<li id="sep"></li> /*here i wanna make it like a line ,that means 1px
height is ok*/
<li>line2</li>
</ul>
with the css like this one
#sep
{
display:block;
width:180px;
height:1px;
padding:0px;
margin:0px;
line-height:0px;
font-size:0pt;
background-color:#FFFFCC;

}
but both in IE and FF there's a Default height looks like 2px
displayed,can I make it 1px height?

or any other way to display a 1px height line between two li elements ?

thanx a lot!!!

May 4 '06 #1
4 2044
da*******@gmail.com wrote:
when I use LI tag as a separator like a line in UL tag

<ul>
<li>line1 </li>
<li id="sep"></li> /*here i wanna make it like a line ,that means 1px
height is ok*/
<li>line2</li>
</ul>


Why do you need a separator? Because in reality there are two lists?
Because each list item should be separated from the next? Use
border-bottom or border-top.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
May 4 '06 #2
In message <11*********************@y43g2000cwc.googlegroups. com>,
"da*******@gmail.com" <da*******@gmail.com> writes
when I use LI tag as a separator like a line in UL tag

<ul>
<li>line1 </li>
<li id="sep"></li> /*here i wanna make it like a line ,that means 1px
height is ok*/
<li>line2</li>
</ul> with the css like this one
#sep
{
display:block;
width:180px;
height:1px;
padding:0px;
margin:0px;
line-height:0px;
font-size:0pt;
background-color:#FFFFCC;

}
but both in IE and FF there's a Default height looks like 2px
displayed,can I make it 1px height?

or any other way to display a 1px height line between two li elements ?


Hmmm... How about this instead?

CSS:

#sep
{
width:180px;
border-bottom: 1px solid #FFFFCC;
margin:0px;
}

HTML:

<ul>
<li id="sep">line1 </li>
<li>line2</li>
</ul>
--
Martin Jay
May 4 '06 #3
da*******@gmail.com wrote:
when I use LI tag as a separator like a line in UL tag

<ul>
<li>line1 </li>
<li id="sep"></li> /*here i wanna make it like a line ,that means 1px
height is ok*/
<li>line2</li>
</ul>


Why don't you just extend the bottom margin of the list item that you
want the separator under?

<ul>
<li style="margin-bottom:1px;">line1</li>
<li>line2</li>
</ul>

where 1px is whatever the default is + 1px
--
ironcorona
May 4 '06 #4
hehe ok, I get it:)

the reson why I need a separator is coming from my experince of win32
application program desgin,

logically , a menu should have separator as a component

and use bottom or top border is fine, thanx a lot~

May 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: delerious | last post by:
I need to determine an element's width and height in pixels (not including padding, border, and margin) in Javascript. The element will not have width or height styles specified. In Mozilla, I...
4
by: Markus Ernst | last post by:
Hi I try to build a website with a css layout. I have for example 2 div elements with a specified width and a float-left, and the 3rd div element has margin:0px which makes it extend to the rest...
4
by: Marek Mänd | last post by:
This seems an IE issue only: 4253 bytes testcase: http://www.hot.ee/idaliiga/testcases/ieselect/bnlinkingselectinmsie.htm Can one have 1) a mouseover/mouseout element on TBODY 2) change in...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
1
by: R0bert Nev1lle | last post by:
Here's my next IE challenge (or frustration). It deals with the overflow attribute. Overflow property was a challenge on my page since the page emulates position fixed for IE. The present...
2
by: Rob T. | last post by:
Given the following in a stylesheet: #parent { width: 50px; height: 50px; } #child {
2
by: Stanimir Stamenkov | last post by:
I'm trying to clear some sizing issues relative to the initial containing block and the root document element. The sample document I'm trying with: http://stanio.info/viewport_fill.html ...
8
by: Gerry Viator | last post by:
Hi all, The following is part of XML file, how do I search through the file and remove an Element and all it's attributes. Example: TEST2? Of course I will pass the Element Name to remove from a...
3
by: blackrunner | last post by:
ERROR in my Query?! ERROR: Element GESCHLECHT is undefined in FORM. i think everything ok. Maby somebody can help me here Element GESCHLECHT is undefined in FORM. The error occurred...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.