473,399 Members | 3,603 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,399 software developers and data experts.

Controlling Spacing Between Two Lines When Using <br />

Is is possible to control spacing between two lines when using <br />? I would like to be able to adjust the spacing between the two lines in each link below so that the two lines sit snugly on top of each other within each anchor without a lot of extra space between each line.

I am self taught in XHTML and CSS and would appreciate any suggestions?

THE XHTML:

<ul id="ns-buttons-links">
<li id="nsbl-request"><a href="#"><span class="nsbl-1st-line">REQUEST</span><br /><span class="nsbl-2nd-line">AN INVESTIGATION</span></a></li>
<li id="nsbl-submit"><a href="#"><span class="nsbl-1st-line">SUBMIT</span><br /><span class="nsbl-2nd-line">YOUR EVIDENCE</span></a></li>
<li id="nsbl-reserve"><a href="#"><span class="nsbl-1st-line">RESERVE</span><br /><span class="nsbl-2nd-line">A HAUNTED ROOM</span></a></li>
<li id="nsbl-email"><a href="#"><span class="nsbl-1st-line">EMAIL</span><br /><span class="nsbl-2nd-line">YOUR COMMENTS</span></a></li>
</ul>

THE CSS:

#nav-sub li#nsbl-request a, #nav-sub li#nsbl-submit a, #nav-sub li#nsbl-reserve a, #nav-sub li#nsbl-email a {
display: block;
width: 130px;
height: 46px;
text-align: center;
text-decoration: none;
padding-top: 3px;
}

#nav-sub ul#ns-buttons-links a .nsbl-1st-line {
font: 110% Georgia, serif;
color: #e8e8e6;
letter-spacing: .1em;
padding-top: 3px;
}

#nav-sub ul#ns-buttons-links a .nsbl-2nd-line {
font: 62% "Lucida Grande", Tahoma, sans-serif;
color: #e8e8e6;
letter-spacing: .1em;
}

#nav-sub ul#ns-buttons-links a:hover .nsbl-1st-line, #nav-sub ul#ns-buttons-links a:hover .nsbl-2nd-line {
color: #293357;
}

For a look at the entire page I'm working on, please go here:

www.williamscreative.com/mmsgh/index.html

I'm also having trouble with the layout breaking in IE 6 and IE 5.5. Everything looks good in the rest of the browsers out there.

Thanks for any help.
Aug 3 '07 #1
5 5774
drhowarddrfine
7,435 Expert 4TB
Just use line-height:0 on nlb-request.
<br/> is not styleable. It only causes the break but the line itself is what causes the sizing.
Aug 3 '07 #2
use a css stylesheet, to creat a style. you can use a div instaed of a break, and then just add padding to the bottom of how much you want or visa versa
Aug 3 '07 #3
Cool! The line height suggestion fixed the spacing problem in the navigation button. Thanks!

Any suggestions on how to remedy the the broken layout in IE 5.5 and IE 6? Have I used floats incorrectly or set a margin wrong?

www.williamscreative.com/mmsgh/index.html
Aug 3 '07 #4
drhowarddrfine
7,435 Expert 4TB
you can use a div instaed of a break, and then just add padding to the bottom of how much you want or visa versa
Absolutely not! This would be equivalent to the old 'spacer.gif' used in table layout. But that's what margins and padding are for. Plus, using a div for spacing is semantically incorrect.

Taftheman,
For the drop down, check your widths. IE tends to add margins/padding/other stuff where there is none. If your divs add up to the total width of the content area, widen it up a few px and see if that makes that third column jump up.

For the images, if you are using transparency on the png's, IE6 does not work with that.
Aug 3 '07 #5
Thanks Doc. Will try your suggestion this evening after work.
Aug 3 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my...
6
by: Lasse | last post by:
I have done this simple function, it seems to work as intended, to solve a problem i have had for a while. I couldnt find any sample around that was working for me. I would like to test it with...
7
by: noor.rahman | last post by:
I have an XML file that stores data from an HTML form. I use XSL to display the data in HTML format. The data may have newline characters. However, XSL is not displaying the newlines properly in...
7
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
2
by: xhe | last post by:
I met a very headache problem in javascript, I think this might be difference between IE and NS / Safari. I have a text area <form> <textarea name='tex1' onkeyup='displayit();'></textarea>...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
13
by: lister | last post by:
If I want to move something to a new line, should I be using <br/>, or is there a way of doing it in CSS? I was just thinking if it was possible in CSS then it would be better as otherwise the...
7
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what...
2
by: Defacta | last post by:
Hello ! How to delete all the new lines and replace them by <br>, because new lines involves Javacript Error, IE: facts_infos = "In 1972 he was done for murdering a colleague over a matter of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.