violet kiwi
violet kiwi

Reputation: 705

how to limit a text or div inside a parent tag

body
{
width:1024px;
height:600px;
}

#footer
{
margin-top:800px;
}

My question is there a way of setting some property in the parent tag body , to limit the child inside that tag (i dont want footer outside the body box model) only even if we SET HIGHER VALUE than parent tag body.

Upvotes: 0

Views: 87

Answers (2)

Frederik.L
Frederik.L

Reputation: 5620

While you should avoid to set a higher value in a child tag, in case it is, you more likely want to use overflow:hidden; who basically hides anything that is "out of bound".

See this working FIDDLE for an example.

Upvotes: 1

user2562966
user2562966

Reputation:

what you are trying to do is not a good coding practice. in this case you should try limiting the target element from the #footer itself. this might help

Upvotes: 1

Related Questions