Discussion:
Drawing Lines from css
(too old to reply)
LondonLad
2008-12-03 18:39:37 UTC
Permalink
Hi
I want to draw a line under a list from my *.css I tried this
code but it did not work how I want. This draws a line in the center
of the page, I want to the left side only.
hr {
color: #FF00FF;
margin-left : 0px;
width : 200px;
}

Can you help please?

Ron
Pete Lees
2008-12-03 18:57:01 UTC
Permalink
Hi, Ron,
Post by LondonLad
I want to draw a line under a list from my *.css I tried this
code but it did not work how I want. This draws a line in the center
of the page, I want to the left side only.
[Snipped]
You could try this:

hr {
text-align: left;
color: #FF00FF;
margin-left : 0px;
width : 200px;
}

Pete
LondonLad
2008-12-04 13:26:55 UTC
Permalink
Hi Pete
Thanks for that, just how I wanted it, if you can spare the time could you
explain why drawing lines
are controlled as text?

Ron
Post by Pete Lees
Hi, Ron,
Post by LondonLad
I want to draw a line under a list from my *.css I tried this
code but it did not work how I want. This draws a line in the center
of the page, I want to the left side only.
[Snipped]
hr {
text-align: left;
color: #FF00FF;
margin-left : 0px;
width : 200px;
}
Pete
David Webber
2008-12-04 17:04:19 UTC
Permalink
Post by LondonLad
Thanks for that, just how I wanted it, if you can spare the time could you
explain why drawing lines
are controlled as text?
The text-align style works on the contents of assorted HTML objects like <p>
<td> <div> and it affects anything that sort runs along with the text
flow - for example images in line with the text (even if there is no text).
So "text-align" is perhaps an imperfect name for it, but is easy to
remember.

BTW There are other ways than <hr> of getting horizontal lines, which align
with things nicely. For example:

<p style="border-bottom: ......;"> is a good way of drawing a line under a
paragraph which is the same width as the paragraph.

Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm
David Webber
2008-12-04 17:38:00 UTC
Permalink
Post by David Webber
The text-align style works on the contents of assorted HTML objects like
<p> <td> <div> and it affects anything that sort runs along with the text
flow - for example images in line with the text (even if there is no
text). So "text-align" is perhaps an imperfect name for it, but is easy to
remember.
Come to think of it, if you give a <div> a style of text-align:center; than
even another <div> (instead of just text) within that will also be centred.

Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm
LondonLad
2008-12-04 17:54:39 UTC
Permalink
Hi David
Thank you for the extra info on text-align, I will try an example later,
working to complete
my first help project at the moment.

Ron
Post by David Webber
Post by David Webber
The text-align style works on the contents of assorted HTML objects like
<p> <td> <div> and it affects anything that sort runs along with the
text flow - for example images in line with the text (even if there is no
text). So "text-align" is perhaps an imperfect name for it, but is easy
to remember.
Come to think of it, if you give a <div> a style of text-align:center;
than even another <div> (instead of just text) within that will also be
centred.
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm
Loading...