Controlling left margin in a DIV

Discussion in 'HTML' started by Peter Charles, Oct 29, 2003.

  1. 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?

    Thanks

    Peter

    turn mailhot into hotmail to reply

    Visit The Streamer Page at http://www.mountaincable.net/~pcharles/streamers/index.html
    Peter Charles, Oct 29, 2003
    #1
    1. Advertising

  2. Peter Charles wrote:

    > 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.
    Leif K-Brooks, Oct 29, 2003
    #2
    1. Advertising

  3. On Wed, 29 Oct 2003 09:48:51 GMT, Leif K-Brooks
    <> wrote:

    >Peter Charles wrote:
    >
    >> 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.


    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
    Peter Charles, Oct 29, 2003
    #3
  4. Peter Charles wrote:

    > <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.
    Leif K-Brooks, Oct 29, 2003
    #4
  5. On Wed, 29 Oct 2003 10:28:28 GMT, Leif K-Brooks
    <> wrote:

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

    >
    >Stop using those attributes!


    OK, I'm easy, suggestions for replacements?

    >
    >> <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.


    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?

    Peter

    turn mailhot into hotmail to reply

    Visit The Streamer Page at http://www.mountaincable.net/~pcharles/streamers/index.html
    Peter Charles, Oct 29, 2003
    #5
  6. Peter Charles

    Steve Pugh Guest

    Peter Charles <> wrote:

    >On Wed, 29 Oct 2003 10:28:28 GMT, Leif K-Brooks
    ><> wrote:
    >
    >>Peter Charles wrote:
    >>
    >>> <BODY BGCOLOR="#66999" TEXT="BLACK" LINK="BLACK" VLINK="#993333"
    >>> ALINK="WHITE">

    >>
    >>Stop using those attributes!

    >
    >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;}

    >>> <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.

    >
    >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

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
    Steve Pugh, Oct 29, 2003
    #6
  7. Leif K-Brooks <> wrote in message news:<gDMnb.1010$>...
    > Peter Charles wrote:
    >
    > > <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.



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

    Peter
    Peter Charles, Oct 29, 2003
    #7
  8. Peter Charles

    Richard Guest

    Peter Charles wrote:

    > 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?


    > Thanks


    > Peter


    > turn mailhot into hotmail to reply


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



    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.
    Richard, Oct 29, 2003
    #8
  9. On Wed, 29 Oct 2003 12:42:36 +0000, Steve Pugh <> wrote:

    >>
    >>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;}
    >

    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
    Peter Charles, Oct 29, 2003
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Terry Burns

    Crystal Reports - Left Margin Question

    Terry Burns, Mar 18, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,886
    Terry Burns
    Mar 18, 2006
  2. Logical
    Replies:
    9
    Views:
    1,601
    Mark Parnell
    Aug 2, 2004
  3. Cal Who
    Replies:
    1
    Views:
    428
    Alexey Smirnov
    May 16, 2010
  4. Cal Who
    Replies:
    4
    Views:
    574
    Cal Who
    May 17, 2010
  5. lawrence
    Replies:
    13
    Views:
    296
    Thomas 'PointedEars' Lahn
    Sep 4, 2004
Loading...

Share This Page