Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Floating DIVS??

  1. #1
    Senior Member ChrisTheCracka's Avatar
    Join Date
    May 2004
    Location
    Bellevue, WA
    Posts
    114
    Member #
    6036
    Hi,

    I'm wondering about creating floating divs. Tekp was nice enough to give me some resources but im still having problems. I want i middle "table" like his site but running from top to bottom., I was told this is a floating div. can anyone give me the code to do this

    Thanks Chris

  2.  

  3. #2
    Senior Member
    Join Date
    May 2004
    Location
    Hawaii
    Posts
    106
    Member #
    6059
    i would not use float.
    try this

    CSS:
    ...
    #main
    {
    margin:auto;
    }
    ...

    HTML
    ...
    <div id="main">
    body content
    </div>
    ...

    remember with css #main can only be accessed once per html page as id="main", where .main can be accessed many times per the class="main"

    do some more research on the differances but this should ive you what you want. oh and one more thing..
    make sure you use this doctype on your head.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    or the page will not center as you desire.

    good luck

  4. #3
    Senior Member ChrisTheCracka's Avatar
    Join Date
    May 2004
    Location
    Bellevue, WA
    Posts
    114
    Member #
    6036
    Im a noob at CSS, nver used it i was just told this would be what i was looking for, so withought bothering you to much

    What would the code look like, what should i name the file also, (for the code i basically nee the whole code so i can figure this out) rember im a noob at CSS

    So, any help would be much appreciated

    Chris

  5. #4
    Senior Member
    Join Date
    May 2004
    Location
    Hawaii
    Posts
    106
    Member #
    6059
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Css and Html</title>
    <style>
    #main
    {
    margin:auto;
    height:300px;
    width:600px;
    background-color:gray;
    }
    </style>
    </head>
    <body>
    <div id="main">
    Main page content the box is 300 pixels high so you can see it, and width of 600 pixels
    cause i picked it randomly anyway... if your not worried about the hight. then i would
    just put height:auto; instead. have fun hope this works. try www.alistapart.com for more info. copy and paste this entire text and
    use it to see how it works. i have put the css into the header but if you like you can put the css in a diff file and just referance it in the header. good luck again. i am here if you have any more questions.

    -Caleb
    </div>
    </body>
    </html>

  6. #5
    Senior Member ChrisTheCracka's Avatar
    Join Date
    May 2004
    Location
    Bellevue, WA
    Posts
    114
    Member #
    6036
    Ok that looks good, but i want it to float off the page kinda, like the one on tekp's site/and a lot of others, like it has a black line, then it has shadows off to the left

    I want a definate LINE ar ound it, i also want it to run "off" the page, like up and down, kinda like this site, (DONT FORGET HAVING IT "float")

    can ANYONE help me out??

  7. #6
    Senior Member ChrisTheCracka's Avatar
    Join Date
    May 2004
    Location
    Bellevue, WA
    Posts
    114
    Member #
    6036
    http://www.alistapart.com/
    I want my site main page to look like this WITH THE LINES vertically
    But i want it to have that drop shadow(floating DIV??)i also want those lines to run right up to the TOP of the browser(like this site it goes Off the page)

    PLZ I NEED HELP FAST

    thanks -Chris

  8. #7
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Add into the css of the thing you want lines around:
    Code:
    border:1px solid #000000;
    should be pretty self explanitory there (the property)
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  9. #8
    Senior Member ChrisTheCracka's Avatar
    Join Date
    May 2004
    Location
    Bellevue, WA
    Posts
    114
    Member #
    6036
    thanks

  10. #9
    Senior Member ChrisTheCracka's Avatar
    Join Date
    May 2004
    Location
    Bellevue, WA
    Posts
    114
    Member #
    6036
    any property i can change for a floating div, thats what i really want

  11. #10
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    Do you know what float means?
    From W3Schools

    Float sets where an image or a text will appear in another element
    The syntax for float is
    Code:
    float:left (or right)
    You don't want to set your whole page to float left or right. What are you trying to do?


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:09 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com