473,386 Members | 1,736 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,386 software developers and data experts.

use style to place an HR at the bottom of a DIV

Hi,

I'm trying to move my site from table layout to div/span CSS layout.

I have a chunk of text and images within a div tag. At the end of that
chunk, but still within the div tag, is an HR. For layout, the div is
min-height:250px tall, which means if you've got standard settings, the
text and images end about 50px before the end of the div. Of course
with HR 50px before the end if the div, it looks funny as the next
element looks like there is too much space at the top. What I want to
be able to do is place the HR at the very botom of the DIV. I have
tried adding a style="vertical-align:bottom" to the HR tag, but that
didn't work. I then added position:absolute to the style atribute and
that moved it all the way to the bottom of the page. I can't force it
to be 250px down from the top of the screen, as the site is dynamically
generated and there might be more the HR would then go through the text
(a bad thing).

Can anyone help me?

Aug 15 '05 #1
4 8697
"Tom Cat" <st******@yahoo.com> wrote:
I have a chunk of text and images within a div tag. At the end of that
chunk, but still within the div tag, is an HR.


The use of <hr>s in modern markup is rarely justified. They are often
used only for styling purposes, in which case they should be removed and
their function moved to CSS. In your case the solution would be to style
the bottom border of the containing div.

--
Spartanicus
Aug 15 '05 #2
Oh wow I didn't know this could be done.

I removed the HR tag and added
border-bottom:solid;border-bottom-width:1px;
to the style atribute in the div tag.

It works really well. The only problem now is that I have to figure
out how to make the line only 30% of the page width and centered in the
text area. My CSS reference doesn't tell me how to do that. Does
anyone here know?

Aug 15 '05 #3
"Tom Cat" <st******@yahoo.com> wrote:
I removed the HR tag and added
border-bottom:solid;border-bottom-width:1px;
to the style atribute in the div tag.

It works really well. The only problem now is that I have to figure
out how to make the line only 30% of the page width and centered in the
text area.


You'd need a separate element for that, but instead of the <hr> element
which suggests a structural division, non semantic markup should be used
if the purpose is decorative, example:
http://homepage.ntlworld.com/spartanicus/temp.htm

--
Spartanicus
Aug 15 '05 #4
The best place to get help when transforming your site from tables to
css is http://www.css-discuss.org/ The mailing list is owned by Eric A.
Meyers. He helped develop CSS for the W3C. You'll need to get an email
address dedicated to this mail list only. You will get between 50-100
emails a day.

Aug 17 '05 #5

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

Similar topics

72
by: Herbert | last post by:
I'm still relativey new to stylesheets, so I'm hoping that the way I'm going about things can be seriously improved upon, i.e . I just haven't undersood something obvious about the 'cascading'...
0
by: Anne van Kesteren | last post by:
Ok, here it goes. Originally I submitted this proposal to www-style. Since I don't get feedback there, I think I missed a few (maybe a lot) of points. Proposal:...
13
by: TheKeith | last post by:
Is it just me or does opera and ie not render the float style properly? IE does a sucky job at it, but opera makes a total mess; Mozilla/Firefox renders it correctly however. I'm just trying to be...
17
by: ryan.fairchild | last post by:
Ok, I have a problem with my boxes. I am making a blog currently but I don't think I am implementing my boes correctly. My website is www.ryanfairchild.com. Currently it looks fine as the...
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...
5
by: MMan22 | last post by:
I'm learning how to use style sheets and so I've been looking how other people use them. I found a style file that set borders and padding to most of the std Tags to zero (sample below). Some get...
15
by: mike | last post by:
I ran across a situation where I could not format my row bottom border color. I was using: <tr style="border-bottom:solid 1px #cccccc;"> and it didn't work, but <td...
12
by: Eric Lindsay | last post by:
I have a web page at http://www.architectqueensland.com/index.html styled with http://www.architectqueensland.com/architect.css The site is valid HTML 4.01 Strict. The CSS is valid 2.1 except for...
1
by: GGG | last post by:
Neither go the way I want them to... Absolute doesn't get it right over multiple browsers. Relative puts it in the right place, but only the portion that it is "relative" the style, #wleMenu, is...
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: 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...
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
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.