Results 1 to 11 of 11

Thread: Division placement

  1. #1
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Division placement

    Hi all,

    Hopefully someone can help :/

    I have been designing / coding a website recently. However I have been having a problem with division positioning and I just cant seem to get to the bottom of it and its beginning to frustrate me :@

    Basically I have the following divs -

    navigation - obviously for navigation
    then divs named one, two, three and four.

    The navigation div has a width of 100% while the other four divs have a width of about 900px or so (for now, will be altering it late more than likely) and the divs are positioned in the centre.

    With the nav bar I have it set so if I click a link the nav bar is fixed position, so the page scrolls so to speak but the nav is always visible, done using jquery.

    I am trying to get division 1 to appear below the nav bar however a bit of the top of the box is appearing under the navigation bar.

    I cant for the life of me get it to appear below the nav bar :/

    Hopefully that makes sense :/
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  2. #2
    Senior Member
    Join Date
    Mar 2012
    Location
    Cambridge
    Posts
    240
    Thanks
    11
    Thanked
    6 times in 6 posts
    • davesom555's system
      • Motherboard:
      • Asrock B450M
      • CPU:
      • AMD 2600@4ghz
      • Memory:
      • 16GB Corsair 3000mhz
      • Storage:
      • 500gb Samsung 970 Evo NVME + multiple 2.5" SSDs
      • Graphics card(s):
      • Sapphire Vega 56 Pulse
      • PSU:
      • EVGA 700w
      • Case:
      • NZXT H400i mATX
      • Operating System:
      • Win 10
      • Monitor(s):
      • Samsung 27" QHD 144mhz
      • Internet:
      • 200mb

    Re: Division placement

    Have you tried making it:

    position: relative;
    top: 10px; (10 is the amount you want to shift them down.)

  3. #3
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Division placement

    I did try that bit it didn't work, however later on I did find an error in the CSS which fixed another problem that may have been affecting this.

    Will check when home and see what happens.
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  4. #4
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,231
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Division placement

    Sounds to me like you need to set margin-top on div 1, then just keep increasing that until the div shifts down enough to be seen when your nav bar is fixed. You could probably tie in setting the margin to the link that also fixes your nav bar, so that when the nav bar isn't fixed you don't have a stupidly big margin on the first div (I have understood that right, haven't I? Your nav bar normally moves, but you can click a link to fix it at the top?)

  5. #5
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Division placement

    Its all fixed
    When ive uploaded my fixes I may well upload what I have so far

    Edit - http://www.shelleys-shop.com decided to upload now, ignore the odd colours and the fact it looks stupid, I like to get thinks looking ok-ish before I start the proper work on my sites.
    Last edited by Disturbedguy; 18-04-2012 at 06:10 PM.
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  6. #6
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,231
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Division placement

    hmmm, not bad

    One thing though - in Chrome it has a gap at the top of the browser so as the sections scroll you can see them above the nav bar. You should be able to get rid of this by adding
    Code:
    <!DOCTYPE html>
    at the very top of the page (this will also make the page HTML5 compliant ). This tells the browser that the html tag is the root of the document - modern browsers seem to assume that they need to add an anonymous root element if the page doesn't have a doctype

  7. Received thanks from:

    Disturbedguy (19-04-2012)

  8. #7
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Division placement

    Quote Originally Posted by scaryjim View Post
    hmmm, not bad

    One thing though - in Chrome it has a gap at the top of the browser so as the sections scroll you can see them above the nav bar. You should be able to get rid of this by adding
    Code:
    <!DOCTYPE html>
    at the very top of the page (this will also make the page HTML5 compliant ). This tells the browser that the html tag is the root of the document - modern browsers seem to assume that they need to add an anonymous root element if the page doesn't have a doctype
    Thanks still a lot of work to do, hoping that when it has some content added it will look better than what it does now.

    Yeah I had noticed that gap and was going to look into removing it today, so thanks for that. Hopefully it will work.

    Hhmm didn't appear to work :/
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  9. #8
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,231
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Division placement

    Quote Originally Posted by Disturbedguy View Post
    Hhmm didn't appear to work :/
    I've just had a look and it's still showing as not having the <!DOCTYPE html> tag - indeed if you view the source in Firefox it highlights that there's an opening tag without <!DOCTYPE html> declaration...

  10. #9
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Division placement

    Quote Originally Posted by scaryjim View Post
    I've just had a look and it's still showing as not having the <!DOCTYPE html> tag - indeed if you view the source in Firefox it highlights that there's an opening tag without <!DOCTYPE html> declaration...
    I should have been clearer I tested it at work on another copy of the site (i mess with it at work when bored ) and it didnt work.

    I will try again when I am home. For the record the >!DOCTYPE html> should be at the top, right?
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

  11. #10
    Not a good person scaryjim's Avatar
    Join Date
    Jan 2009
    Location
    Gateshead
    Posts
    15,196
    Thanks
    1,231
    Thanked
    2,291 times in 1,874 posts
    • scaryjim's system
      • Motherboard:
      • Dell Inspiron
      • CPU:
      • Core i5 8250U
      • Memory:
      • 2x 4GB DDR4 2666
      • Storage:
      • 128GB M.2 SSD + 1TB HDD
      • Graphics card(s):
      • Radeon R5 230
      • PSU:
      • Battery/Dell brick
      • Case:
      • Dell Inspiron 5570
      • Operating System:
      • Windows 10
      • Monitor(s):
      • 15" 1080p laptop panel

    Re: Division placement

    yep, should be the first thing on the page - it tells the browser what kind of document to expect.

  12. #11
    HEXUS.social member Disturbedguy's Avatar
    Join Date
    Nov 2006
    Location
    Manchester
    Posts
    5,113
    Thanks
    841
    Thanked
    482 times in 357 posts
    • Disturbedguy's system
      • Motherboard:
      • Asus Rog Strix Z370-H Gaming
      • CPU:
      • i7 8700K
      • Memory:
      • 16GB Corsair something or other
      • Storage:
      • 1 x Samsung 960 EVO (250GB) 1 x Samsung 850 EVO (500GB)
      • Graphics card(s):
      • GTX 1080Ti
      • Operating System:
      • Windows 7 Ultimate
      • Monitor(s):
      • 32inch Samsung TV
      • Internet:
      • Crap

    Re: Division placement

    I fixed it, with this

    <style type="text/css">

    html, body, div {
    padding:0;
    margin:0;
    }

    in the html
    Quote Originally Posted by TAKTAK View Post
    It didn't fall off, it merely became insufficient at it's purpose and got a bit droopy...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •