Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Problem with DIV tags  (Read 5102 times)

0 Members and 1 Guest are viewing this topic.

Zylstra

    Topic Starter
  • Moderator


  • Hacker

  • The Techinator!
  • Thanked: 45
    • Yes
    • Technology News and Information
  • Certifications: List
  • Computer: Specs
  • Experience: Guru
  • OS: Windows 7
Problem with DIV tags
« on: April 22, 2010, 05:02:20 PM »
Okay, so here is my problem:
I'm a picky web designer who does not like massive empty space, so I refuse to center layers. (There, I admitted it).

Anyways, on this website I am creating, I've come across an issue. The text is so close to the left side of the browser that it is hard to read, especially if your monitor goes past the sides by just a little bit.

Check out what it looks like:
http://zylblog.info/waterville/

How can I fix that sort of problem?

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Problem with DIV tags
« Reply #1 on: April 22, 2010, 07:09:22 PM »
well, the top-level div is set to:

Code: [Select]
<div id="container" style="left: 0px; top: 0px">

if you remove the style= attribute, then the browsers default margin settings will be used.

you could then change the <div id="navigation"> div to read:

Code: [Select]
<div id="navigation" style="left:0px;top:0px">
so that the menu is left aligned; same for the footer div.


I don't use dreamweaver or any other "design" software and create all my pages myself via CSS,HTML and PHP, so I don't know how you'd do this in Dreamweaver (short of manually editing the code); I'd imagine these settings are buried somewhere, though.
I was trying to dereference Null Pointers before it was cool.

Vikram Varaprasad



    Intermediate
  • Thanked: 6
    Re: Problem with DIV tags
    « Reply #2 on: April 22, 2010, 09:49:19 PM »
    Use "padding-left" style property to all the tags which placed on left side....... this will give some space for the content with the tags, but the tag placements won't change. ( you said you won't like empty space )
    Vikram...

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Problem with DIV tags
    « Reply #3 on: April 23, 2010, 10:11:19 AM »
    Set the body and html properties a margin and padding of 0. Then set the #container div's padding values.

    soybean



      Genius
    • The first soybean ever to learn the computer.
    • Thanked: 469
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 10
    Re: Problem with DIV tags
    « Reply #4 on: April 23, 2010, 11:46:36 AM »
    Set the body and html properties a margin and padding of 0. Then set the #container div's padding values.
    Such as this?

    <div id="container" style="left: 5px; top: 5px">

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Problem with DIV tags
    « Reply #5 on: April 23, 2010, 12:54:40 PM »
    No, they're position properties.

    Vikram Varaprasad



      Intermediate
    • Thanked: 6
      Re: Problem with DIV tags
      « Reply #6 on: April 23, 2010, 09:24:32 PM »
      Code: [Select]
      <div id="container" style="padding-left: 5px; padding-top: 5px">
      Vikram...

      freelance USA



        Newbie

        Re: Problem with DIV tags
        « Reply #7 on: May 06, 2010, 02:08:40 AM »
        You should creat a div which cover all other divs. And then set margin-left of your choice.


        Marry
        no spam, thanks
        « Last Edit: May 06, 2010, 10:02:40 AM by kpac »

        Zylstra

          Topic Starter
        • Moderator


        • Hacker

        • The Techinator!
        • Thanked: 45
          • Yes
          • Technology News and Information
        • Certifications: List
        • Computer: Specs
        • Experience: Guru
        • OS: Windows 7
        Re: Problem with DIV tags
        « Reply #8 on: May 15, 2010, 06:54:19 PM »
        <div id="container" style="padding-left: 5px; padding-top: 5px">
        That worked perfectly!
        Sorry for my delay, I took some time off and I forgot to check back.

        Best,
        Jesse Zylstra

        jettlee1



          Starter

          Re: Problem with DIV tags
          « Reply #9 on: May 29, 2010, 04:30:10 AM »
          set your margin. to run the div tag.

          kpac

          • Web moderator
          • Moderator


          • Hacker

          • kpac®
          • Thanked: 184
            • Yes
            • Yes
            • Yes
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 7
          Re: Problem with DIV tags
          « Reply #10 on: May 29, 2010, 04:51:34 AM »
          This has already been solved, thanks.

          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: Problem with DIV tags
          « Reply #11 on: May 29, 2010, 09:31:52 AM »
          Q. How do I fix my margins?

          A. Fix your margins.


          Now THAT is support!  ::)

          I was trying to dereference Null Pointers before it was cool.