• I’m using the “Alterna 7” premium theme from ThemeForest.net. It has 5 different header styles, and I’m using header style 1 which I am trying to customise.

    In this header style, there is a container with two div sections – one for a logo which is set to float left, and the other which is for some social media icons and floats right.

    Both of these div sections fit to their contents:-

    div class=”logo” – width = 185px (the width of my current logo image)
    div class=”header-custom-container” – width = 145px (the width of the social media images side by side)

    The container surrounding these divs is currently 1140px – but I think that this size is dynamic based on screen resolution

    I have created a new div section which should be sandwiched between the logo and header-custom-container. My problem is, that without specifying a width, this new div section also fits to whatever content I put in.

    Ideally what I would like to do is this:-
    Whichever of the two original div sections is widest, subtract 2 x it’s number of pixels from the surrounding container (in this case 1140 – 185 – 185), then allocate the remaining width to the new div section.

    Of course, depending on which original div section is widest must also determine whether the new div section is floated to the left or right!!!

    Any ideas?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic width "custom" div in header’ is closed to new replies.