How do I get an element to ignore another's margin, or remove that margin?

时间:2016-04-04 16:42:10

标签: html css layout

Another quite simple problem which is turning out to be rather a nuisance. If I'm doing/missing something that's idiotic feel free to lay it on me :)

Explanation:

I have a website in progress of being made (a project for school) and I'm trying to get a 'News Column' on the right-hand side of each page. I've managed to create it, however on one page it's being affected by another element's margin. Look at the following:

http://puu.sh/o5UXs.png - This is the margin on the right that's restricting the News Column from being in that position.

http://puu.sh/o5UYD.png - This is the complete News Column (currently, as data can be added to the database).

I was to have the News Column be alongside it.

My Current CSS:

http://puu.sh/o5Vb1.png

Hope someone can help,

Jake

1 个答案:

答案 0 :(得分:0)

You can use position: absolute or position: fixed.

Sometimes adding negative margin to an element may cause it to ignore another element's margin, but I don't recommend it.


Read this resource, it'll help you.