473,396 Members | 2,024 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,396 software developers and data experts.

forcing two hr on the same line

I'm trying to have several <hr>, all on the same line, even if this can
seem a nonsense, with the shortest code.
So, I do not want to use abolute positioning and virtual div.

Is it possible to obtain such for the following html code:

<hr style="width: 20px;">
<hr style="width: 20px;">
<hr style="width: 20px;">
<hr style="width: 20px;">

with some css? The following css does not work:

hr {
display: inline;
float: left;
}

and the same for the following one:

hr {
line-height: 0;
}

Thanks for your help.

Jan 5 '07 #1
3 10452

co***@mailinator.com wrote:
I'm trying to have several <hr>, all on the same line
Just floating them ought to work. As is well known, IE wants to see an
explicit width on floated things, but you already have that. You
shouldn't need the display:inline;, floating alone is adequate.

As it clearly doesn't work under IE7, I think it's another IE bug. It's
known to be weird with <hr>. If it matters to you, I suggest
pragmatically replacing the <hrwith <divand making them tiny but
with a visible top border.

You'll want somethign after them to clear the float too
..hr {
float: left;
width: 20px;
/* If you don't have some margin too,
what's the difference from using a single 80px wide <hr? */
margin: 0 10px;
}

div.hr {
border-top: thin solid black;
}

[...]

<div class="hr" </div>
<div class="hr" </div>
<div class="hr" </div>
<div class="hr" </div>
<div style="clear: both; float: none; height: 0; margin: 0; padding:
0;" ></div>

Jan 5 '07 #2
Scripsit co***@mailinator.com:
I'm trying to have several <hr>, all on the same line, even if this
can seem a nonsense, with the shortest code.
The structural meaning of <hr>, if any, is 'change of topic'. Why would
would you change topic several times on the same line? And why would the
shortness of code matter? If this is a stupid contest, you should have told
that. (In that case, I might have wished to help you win it. But now you
asked it as if it were a serious question.)

I suspect what you actually want is a particular visual effect. Why don't
you describe the effect, illustrate the context with a URL, and ask in
c.i.w.a.stylesheets then?
So, I do not want to use abolute positioning and virtual div.
That's your privilege (or contest rules?), but by excluding possibilities,
you're not making things any easier.
Is it possible to obtain such for the following html code:
- -
with some css?
This group is about HTML, not CSS.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jan 5 '07 #3
Andy Dingley wrote:
co***@mailinator.com wrote:
I'm trying to have several <hr>, all on the same line

Just floating them ought to work. As is well known, IE wants to see an
explicit width on floated things, but you already have that. You
shouldn't need the display:inline;, floating alone is adequate.

As it clearly doesn't work under IE7, I think it's another IE bug. It's
known to be weird with <hr>. If it matters to you, I suggest
pragmatically replacing the <hrwith <divand making them tiny but
with a visible top border.
Or drop the DIV border and put HR elements inside (appropriately
positioned) DIVs.

[...]

--
Rob

Jan 9 '07 #4

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

Similar topics

4
by: Bernard Cosell | last post by:
I've been through the docs and I'm more than a little confused: I'd like to run PHP apps as ordinary CGI programs. I though/hoped there'd be a command line switch that'd tell PHP to run in...
0
by: Hugh Lutley | last post by:
I'm trying to install the Device::SerialPort module using CPAN but whilst CPAN is running 'make test' a couple of errors are flagging so I cannot continue the install without forcing it. I'm not...
1
by: John M | last post by:
Hello All, The code below is something I have been working on and just can't get past. I know it must be very simple but here goes. The Form Method line text is invisible on browers, but still...
3
by: William Park | last post by:
(Cross-posted because I use Mozilla Firefox, but I think it's also CSS issue.) Usually when I move mouse over a link, the URL is displayed at the bottom on "status line". On some website,...
4
by: Christopher Finke | last post by:
I am writing a Web-based text editor that will be used mainly for editing code. To facilitate this task, whenever the Enter button is pressed within the textarea, the event is caught and the next...
5
by: Nikola Skoric | last post by:
Is there a way to tell the interpreter to display exceptions, even those which were captured with except? -- "Now the storm has passed over me I'm left to drift on a dead calm sea And watch...
3
by: eross | last post by:
Noob here, I am trying to manage calls from multiple clients to my web service by only letting one execute at a time and forcing the others to wait. Code is as follows: ...
1
by: camphor | last post by:
hi all, I have a webpage with just images and am using a liquid layout for my css, go to http://www.christinebec.com/About CB/selected_editorials.htm to see what I am talking about, after the...
5
by: David Thielen | last post by:
Hi; We keep having to restart IIS after ASP.NET kills it. Below is what we have in the event log. Any idea what the problem is? thanks - dave Event code: 3003 Event message: A validation...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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:
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.