CSS layout

Discussion in 'Computers and The Internet' started by Duck, Nov 22, 2006.

  1. Duck

    Duck quack. Lifetime Supporter

    Messages:
    22,614
    Likes Received:
    47
    I'm so used to frames...
    can I have it so a link changes the content of one of my divs?? (without much/too much java)
     
  2. a_rabid_pineapple

    a_rabid_pineapple Member

    Messages:
    456
    Likes Received:
    1
    Try this tutorial on CSS layouts: http://www.stopdesign.com/present/2004/ddw-seattle/tables/

    This tutorial helped me out when I first learned CSS, since I was having a hard time grasping how to structure it since I was so used to tables. You can skip the first couple of slides since all it does is compare CSS vs. table layouts. It's tries to be idiot proof so it doesn't show any coding.

    One thing that I find very helpful when making a CSS layout is when you're first trying to write it, give them borders with bright, obnoxious colors! Giving all the parts of your CSS a borders helps because you can see if they're overlapping or doing other evil things you don't want them to. Once they start to behave then remove the borders.

    Overall the best advice I can give you is not to give up and try many different ways of structuring your layout. If using floats drives you mad then try an asolute layout and vice versa. Also I recommend checking your CSS layout in a W3C compliant browser if you're not already, then add hacks to get the layout to work in IE.
     
  3. Duck

    Duck quack. Lifetime Supporter

    Messages:
    22,614
    Likes Received:
    47
    I actually tried that, but I couldn't even get the borders working :p

    all I was missing was a /DIV tag :p
     
  4. brack1936

    brack1936 Member Lifetime Supporter

    Messages:
    985
    Likes Received:
    46
    G'day Duck. I absolutely love CSS because it gives me heaps of flexibilitly. There used to be many problems with Netscape and such when it came to decoding it. But anyhoo, I used a lot of CSS when building http://geocities.com/yearighto1892/adv.htm
    and it was the best language for this particular page. If you right click on the page and select "view source," Then you will see that each div starts with < div id="number1" style="position:absolute; left:$px; top:$px;" >, and it, of course must end with < /div >. Remember that they are simply layers and each of the layers need to be placed according to what they should be in front of and what they should be behind. That's where it gets 'fun.' If I get around to it, I will put a quick CSS tutorial on my site, (http://www.geocities.com/roaming_refugee ) so keep checking for the next couple of days. And sign the guestmap
     
  5. Duck

    Duck quack. Lifetime Supporter

    Messages:
    22,614
    Likes Received:
    47
    new question:
    I'm so used to frames...
    can I have it so a link changes the content of one of my divs?? (without much/too much java)
     
  6. Columbo

    Columbo Senior Member

    Messages:
    1,375
    Likes Received:
    1
    apparently the answer is yes.
    http://www.thescripts.com/forum/thread90879.html
    Code:
    <html>
     <head><title>Try</title>
     <script>
     function change() {
     var div = document.getElementById("firstDiv");
     var old = div.childNodes[0];
     var xxx = document.createElement("form");
     var son = document.createElement("input");
     div.replaceChild(xxx, old);
     div.childNodes[0].appendChild(son).setAttribute("type", "text");
     }
     </script>
     </head>
     <body>
     <div id="firstDiv"><img id="whatever" src="fotografie.jpg" /></div>
     <div id="another"onClick="change();">clickme!</div>
     </body>
     
    also I googled for
    "link chaging the content of div"
    and this google page appeared, full of info
    Google is a very useful site !
     
  7. Duck

    Duck quack. Lifetime Supporter

    Messages:
    22,614
    Likes Received:
    47
    so is this forum, for when you are too lazy or busy to be searchign through google :D

    thank you for doin the dirty work
     
  8. brack1936

    brack1936 Member Lifetime Supporter

    Messages:
    985
    Likes Received:
    46
    Yes - thank you. That's also what I'm trying to figure out how to do.
     
  9. Adderall_Assasin

    Adderall_Assasin Senior Member

    Messages:
    1,266
    Likes Received:
    1
    CSS was funny to learn. trial and error
     
  10. Columbo

    Columbo Senior Member

    Messages:
    1,375
    Likes Received:
    1
    Dont mention it - cuz if thats your attitude - you know exactly what you can do !
     
  11. Duck

    Duck quack. Lifetime Supporter

    Messages:
    22,614
    Likes Received:
    47
    give you a big wet kiss on the cheek?! =D
     
  12. Columbo

    Columbo Senior Member

    Messages:
    1,375
    Likes Received:
    1
    no you can duck my sick

    sorry i meant ....
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice