Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS css help for float

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #296986
    akm
    Participant

    i have written some code in css and html but float is not working. i want the site name and logo at left side and menu or nav at right side

    link of codepen

    #296995
    vulkanus
    Participant

    Hi,

    Try this:

    .homepage {
    padding-left: 20px;
    float: left;
    left: 100px;
    position: absolute;
    top: 0;
    }

    nav {
    margin: 0 auto;
    text-align: right;
    float: right;
    right: 100px;
    position: absolute;
    }

    #297011
    Paulie_D
    Member

    Please! – position:absolute is the worst nuclear option.

    The primary issue is :

    header * {
        display: inline-block;
    }
    

    Just remove that and half your problems are solved.

    https://codepen.io/Paulie-D/pen/XWWJrmV

    #297014
    akm
    Participant

    thanks bro

    #297015
    vulkanus
    Participant

    Yes
    didnĀ“t see header* inline-block.

    #297017
    akm
    Participant

    but now the problem is that navigation section is table format

    #297048
    JeroenR
    Participant

    If you mean the vertical stack of list items, try display: flex in your nav ul or display: inline-block in your nav ul li. Whichever suits you best.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.