Controlling left margin in a DIV

L

Leif K-Brooks

Peter said:
I have some menu links set up in a DIV. Without the DIV, they will
align along the left edge of the frame. With the DIV, the left margin
is indented about 1/2 inch when I'd like them without the indent.

Ideas?

I sneezed on my crystal ball and it broke, so I'll need to see the page.
 
P

Peter Charles

I sneezed on my crystal ball and it broke, so I'll need to see the page.

doncha just hate it when that happens -

for the crystal ball impaired

<STYLE TYPE="text/css">
<!--
..nounderline A
{
text-decoration:none;
font-size:10pt;
}

-->
</STYLE>


</HEAD>
<BODY BGCOLOR="#66999" TEXT="BLACK" LINK="BLACK" VLINK="#993333"
ALINK="WHITE">

<DIV CLASS="nounderline">
<UL>
<a href="home.html" Target="main"> Home </a> <BR>
<a href="techmenu.html" Target="menu"> Technique </a> <BR>
<a href="tackle.html" Target="main"> Tackle </a> <BR>
<a href="flies.html" Target="main"> Flies </a> <BR>
<a href="books.html" Target="main"> Books </a> <BR>
</UL>
</DIV>


Peter

turn mailhot into hotmail to reply

Visit The Streamer Page at http://www.mountaincable.net/~pcharles/streamers/index.html
 
L

Leif K-Brooks

Peter said:
<BODY BGCOLOR="#66999" TEXT="BLACK" LINK="BLACK" VLINK="#993333"
ALINK="WHITE">

Stop using those attributes!
<DIV CLASS="nounderline">
<UL>
<a href="home.html" Target="main"> Home </a> <BR>
<a href="techmenu.html" Target="menu"> Technique </a> <BR>
<a href="tackle.html" Target="main"> Tackle </a> <BR>
<a href="flies.html" Target="main"> Flies </a> <BR>
<a href="books.html" Target="main"> Books </a> <BR>
</UL>
</DIV>

The ul is giving you the margin, not the div.
 
S

Steve Pugh

Peter Charles said:
OK, I'm easy, suggestions for replacements?

CSS.
body { background-color: #669999; color: #000000; }
a:link {color: #000000; background-color: #669999;}
a:visited {color: #993333; background-color: #669999;}
a:active {color: #FFFFFF; background-color: #669999;}
Since I want to eliminate the underline on the links for style
reasons, if I eliminate the UL, I get the underline back. Anyway to
force the margin?

That sounds unlikely, but as what you have is completely invalid we
shouldn't really worry about the details of browser error correction
but should instead replace it with something better.

You can not have anything as a child of <ul> except <li>

The above looks like a list, so how about:

<ul class="menu">
<li><a href="home.html" target="main">Home</a></li>
<li><a href="techmenu.html" target="menu">Technique</a></li>
<li><a href="tackle.html" target="main">Tackle</a></li>
<li><a href="flies.html" target="main">Flies</a></li>
<li><a href="books.html" target="main">Books</a></li>
</ul>

ul.menu { margin-left: 0; padding-left: 0; list-style-type: none; }
..menu a {text-decoration: none}

Of course, black with no underline will look like ordinary text rather
than links, which is a problem.

Steve
 
P

Peter Charles

Leif K-Brooks said:
Stop using those attributes!


The ul is giving you the margin, not the div.


Scratch my previous reply about <UL> -- the penny just dropped. It's
been a while . . . .

Peter
 
R

Richard

Peter said:
I have some menu links set up in a DIV. Without the DIV, they will
align along the left edge of the frame. With the DIV, the left margin
is indented about 1/2 inch when I'd like them without the indent.



turn mailhot into hotmail to reply


In your <ul> use margin-left:. Ths changes the default indent.

<ul style=margin-left:5px;>
<li>item 1</li>
<ul style=margin-left:10px;>
<li>item 2</li>
</ul>

I nested to show you that you can change the margins as desired.
 
P

Peter Charles

CSS.
body { background-color: #669999; color: #000000; }
a:link {color: #000000; background-color: #669999;}
a:visited {color: #993333; background-color: #669999;}
a:active {color: #FFFFFF; background-color: #669999;}
Thanks

That sounds unlikely, but as what you have is completely invalid we
shouldn't really worry about the details of browser error correction
but should instead replace it with something better.

You can not have anything as a child of <ul> except <li>

Ya, I know, I used lists a lot in the past however, this is my first
time using CSS and DIV so when I did the nounderline thingie, I
pinched a bit of code from IDOCS which included the <UL> just as shown
in my code. I forgot the <LI> and the penny just didn't drop that
<UL> was an unnecessary component for the nounderline. At the time, I
thought it was some weird shit for DIV that I wasn't familiar with.
This morning, I did the head slap, DUH!

That's what happens when you only play with HTML once in a blue moon.

Thanks



Peter

turn mailhot into hotmail to reply

Visit The Streamer Page at http://www.mountaincable.net/~pcharles/streamers/index.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top