PDA

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?

Meti
08-10-2008, 12:53 PM
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;
}

Moh
08-10-2008, 01:11 PM
Explain it a little bit more please..

Stepheen
08-10-2008, 01:57 PM
just add
background-repeat: repeat;
Not hard :/

Meti
08-10-2008, 02:55 PM
Repeat what? :P

background-repeat: repeat-x; (it goes down)
background-repeat: repeat-y; (it fills the screen)

L?KE
08-10-2008, 03:07 PM
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)

Meti
08-10-2008, 03:34 PM
Oopppsss. Sorry, my bad :'(

Eego
08-10-2008, 05:19 PM
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.

L?KE
08-10-2008, 08:06 PM
Yeah, forgot that :) ty craig.

@meti; calm it dear ;)

Meti
09-10-2008, 06:11 PM
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 :(.

Blob
10-10-2008, 11:32 AM
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 :]

Meti
14-10-2008, 07:42 PM
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!