473,791 Members | 3,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2063
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************ *********@y43g2 000cwc.googlegr oups.com>,
"da*******@gmai l.com" <da*******@gmai l.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,ca n 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;">li ne1</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
21545
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 know I can use document.defaultView.getComputedStyle() to do this. IE does not support document.defaultView.getComputedStyle(). It supports offsetWidth/offsetHeight, but those include the padding and border. IE also supports...
4
2471
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 of the window (or the containing element). Now this works well horizontally, but not vertically. Elements with margin:0px are only as high as the text they contain. Is there a way to make an element extend to the available height with css...
4
3867
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 thoise event handler background colors 3) have a specified heighted SELECT element, that doesnt flicker when the event handlers are get called.
21
3993
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 nothing in IE. I'd be greatful for any assistance. Also, if I will have problems the code on Opera or Safari, I'd appreciate any pointers--I don't have a Mac to test Safari. THanks very much, Michael
1
4741
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 scenario deals with the pre element. Sometimes the content in the pre container exceed the parent container's width. IE expands the parent containers width as a result. The workaround for this scenario relates to the overflow property and using a...
2
2936
by: Rob T. | last post by:
Given the following in a stylesheet: #parent { width: 50px; height: 50px; } #child {
2
2425
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 Basically, for some tests I want to specify the height of an example DIV element inside the BODY using percentages of the viewport height. For this to work the BODY container should fill the viewport height where I'm using:
8
10507
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 control. - <Forms> - <Form Name="TEST1">
3
4311
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 in \anmeldung2.cfm: line 404
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10428
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.