Jump to content


Css Layout


8 replies to this topic

#1 Bl4ck-Vip3r

    Young Padawan

  • Members
  • Pip
  • 41 posts

Posted 26 January 2007 - 03:00 PM

Hey, I have made a simple layout (Mainly just boxes, i'll post if you like) and am trying to code it with css and it seems to not be going to well. When i code a box (i.e the main content box) i have a top, middle and bottom.

Top = div with the top of the box as the bg.
Middle = div with the the main bg in it, and where i will type my text.
Bottom = div with bottom of box.

But when i type text ot whatever in it it doesnt wrap to the next line it just carries on going. :s and if i try and do it the opposit way, ei

left, middle and right then the right border of the box always drops down when i add conent to the middle :S im not used ot using css as the last time i coded a site was in html with tables and so far this seems far less confuzing but i keep running into little bugs, if anyone can help then please do :) thanks.

#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 972 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 26 January 2007 - 04:28 PM

Just look around and study CSS by reading up on it. Plenty of tutorials exist on this.

http://www.pixel2life.com/search/14/tablel...ontent%20box/1/

#3 blacky

    Young Padawan

  • Members
  • Pip
  • 34 posts
  • Gender:Male

Posted 26 January 2007 - 04:51 PM

hopefully you didn't add dummy text like a really long word like "akalkssssjklsdjfjjffjfjdskdlsldfjdfsld", cause that would make any layout break

if you didn't do that, maybe you didn't add a width to the middle div.

*wrong forum btw* :)

Edited by blacky, 26 January 2007 - 04:52 PM.


#4 Bl4ck-Vip3r

    Young Padawan

  • Members
  • Pip
  • 41 posts

Posted 26 January 2007 - 06:06 PM

Omg Duhhh was a simple solution :) thanks alot :) it was the dummy text lol i added dddddddddddddddddddddd.. etc to fill it up but after you said that i realised it wouldn't wrap a word and since there are no spaces in it thats was it looks like. What forum should this be in? 1 last question on css.. i have the layout coded and for the footer i have added copyright bla bla bla and would like to add
[Faq - Contact] on the right, how would i do this?, i have tried a seperate div inside the footer div and flot it to the right but this messes it up and i would prefare not to use   many times :P.

#5 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 972 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 26 January 2007 - 08:33 PM

I usually end up doing something similar to this.

HTML
<div class="clear" id="footer">
<div class="left">&copy; Yoursite.com</div>
<div class="right">[<a href="/faq/">Faq</a> - <a href="/contact/">Contact</a>]</div>
</div>
<br class="clear" />
<!-- Having a line break with the clear property helps align everything when using floats -->

CSS
.left{ float:left; } /* Float stuff to the left */
.right{ float:right; } /* Float stuff to the right */
.clear{ clear:both; } /* Make stuff show up after each side is clear */


#6 Bl4ck-Vip3r

    Young Padawan

  • Members
  • Pip
  • 41 posts

Posted 27 January 2007 - 04:09 AM

Thanks for the help :) Whats the difference between div class and Id, i know id is like the name of the div, us class like an editable property which you can customise ? :s

#7 Bl4ck-Vip3r

    Young Padawan

  • Members
  • Pip
  • 41 posts

Posted 27 January 2007 - 04:18 AM

I tried that and the faw box still ends up below the footer bar on the right :S

#8 smart-coder

    Young Padawan

  • Members
  • Pip
  • 16 posts

Posted 29 January 2007 - 06:38 PM

Umm, this is in the wrong forum, and if you dont know css well. Go to www.w3schools.com

They have awsome tutorials on CSS.

#9 panda

    Young Padawan

  • Members
  • Pip
  • 40 posts

Posted 30 January 2007 - 10:45 AM

I know this sounds strange but thanks alot for this topic, It helped me out lots ;)
is that how you make expandable content then just code the middle top and bottom so only the nuddle expands? learn something new every day ey?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users