Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2009
    Posts
    204
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Floating divs and fixed items on multiple pages

    Hello,
    So far I used absolute positioning on my website but so many people told me that it is not the way to go so, on my next website i will start with floating divs. However now I am faced with a problem. Lets say I have top and side menu bars, a logo that I display on every page. With absolute positioning i was able to write their locations on a single file and call that file with php include on every page. Then on each page the rest of the items which are only special to that page were also displayed with absolute positioning.

    But now if i do a similar file for universal items with floating divs, when i call that file on each page, what about the specific items on each page? how will i position them, with respect to the universal items, which is brought to that page by php include for universal items?

    Take this as a very general question, how do you start the structuring of a website by floatign divs, when you have to display same items on many pages and then the rest will be specific items for that page?

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,694
    Thanks
    22
    Thanked 1,832 Times in 1,816 Posts
    Hello ketanco,
    It sounds like you were using inline styles on your absolute positioned elements. Have a look at how a single external CSS stylesheet can style 100s of pages in your website - http://www.w3schools.com/CSS/css_howto.asp
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Regular Coder
    Join Date
    Jul 2009
    Posts
    204
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    Hello ketanco,
    It sounds like you were using inline styles on your absolute positioned elements. Have a look at how a single external CSS stylesheet can style 100s of pages in your website - http://www.w3schools.com/CSS/css_howto.asp
    No I was using CSS I know whatyou mean, that is not the problem. The question is, when I use floating divs, instead of absolute positioned divs, for the page specific items that I need to display on each page, how do I relate them to the universal/fixed items that are displayed on that page ?

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,694
    Thanks
    22
    Thanked 1,832 Times in 1,816 Posts
    I guess I don't understand what your trying to do. Do you have an example of something that's not working?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Regular Coder
    Join Date
    Jul 2009
    Posts
    204
    Thanks
    27
    Thanked 0 Times in 0 Posts
    no not yet. I didnt do anything on it yet, first i was trying to understand the strategy. Ok let me ask this way....

    Say you will start a website from scratch and everything willbe positioned using floating divs.
    First of all this is the way to go instead of absolute positioning right?
    If this is the way to go, how do you display the logo, the top menu, the bottom menu that you want to display on every page? I assume you have a file for each of them, and then you include them in all pages? But how do you position them using floating divs? With absolte positining it was easy. But now these will be in floating divs, but in that case how do you position the page specific items with respect to fixed items?

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,694
    Thanks
    22
    Thanked 1,832 Times in 1,816 Posts
    Quote Originally Posted by ketanco View Post
    First of all this is the way to go instead of absolute positioning right?
    It is.
    in general, when creating a layout, you should try and work as much with the normal flow of the document as possible. Let the elements themselves help position those that come after them.

    In some cases though, you will want to use floats. Floats are also taken out of the normal flow of the document but content will flow around the outside of a float, which is not the case with absolutely positioned elements. Floats can also be cleared to have content appear below the area of the float. These two factors make floats more flexible as a layout device than absolutely positioning.
    Quote Originally Posted by ketanco View Post
    no not yet. I didnt do anything on it yet, first i was trying to understand the strategy.
    Maybe you should just dive in and give it a try. It may not be as big a problem in actuality as it is in theory.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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