View Full Version : CSS position help.
HabbDance
08-10-2008, 01:04 AM
Need help positioning my div in my CSS layout.
I cannot use...
}
#box {
position:absolute;
left:100px;
top:100px;
because, when the box expands, the background does not expand with it.
I kind of explained that bad, but can anyone help me );?
craigg.
08-10-2008, 07:11 AM
If you could explain better I could help. Do you have an online preview of your problem?
If you dont have an online preview could you post your HTML and CSS?
That code makes me want to sleep. Lol. Anyways, do you want to center it or what?
If you want to center the box:
.box {
background-image: url(folder/image.png);
width: 100px;
height: 100px;
margin: auto;
}
Explain it a little bit more please..
Stepheen
08-10-2008, 01:57 PM
just add
background-repeat: repeat;
Not hard :/
Repeat what? :P
background-repeat: repeat-x; (it goes down)
background-repeat: repeat-y; (it fills the screen)
Repeat what? :P
background-repeat: repeat-x; (it goes down)
background-repeat: repeat-y; (it fills the screen)
That is sooo wrong.
Have you not done maths.
repeat-x = repeat across the x-axis (horizontally)
repeat-y = repeat across the y-axis (vertically)
Oopppsss. Sorry, my bad :'(
not sure what you mean but try
overflow: hidden;
craigg.
08-10-2008, 06:52 PM
Repeat what?
background-repeat: repeat-x; (it goes down)
background-repeat: repeat-y; (it fills the screen)
That is sooo wrong.
Have you not done maths.
repeat-x = repeat across the x-axis (horizontally)
repeat-y = repeat across the y-axis (vertically)
and to state the obvious "background-repeat: repeat;" repeats in both the x and y axis.
Yeah, forgot that :) ty craig.
@meti; calm it dear ;)
LOl Luke :D
HabbDance
Did you get the help you needed?
--ss--
09-10-2008, 06:15 PM
#box {
margin-top: 100px;
margin-left: 100px;
}
Add overflow-hidden; to the container.
Nothing to do with the background-repeat as by default it get's tiled automatically.
Oh darn, messed up my post count now :(.
or instead of writing background-repeat: cos that is gay, you can do
background: url('image.gif') repeat;
HabbDance
14-10-2008, 01:04 AM
oops, forgot about this thread ^.^
ty to all who tried but --ss-- got it right :]
Lol. we all tried to post something :P
You didn't tell us enough info :P
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.