I am relatively new to CSS. I have a table on my page which has a width of 70%. I need to position a small icon just above the right side of the table so that the icon is aligned with the right margin of the table below it. How can I achieve this?
So generically this question would be how to position elements relative to the position of other elements on a page using CSS?
Thanks, Calvin
Hi now you can do this easily throw Position Give to Parent Position Relative
and child to give position Absolute
and do top right according to your layout
Live demo
http://jsfiddle.net/srgJh/
In CSS you should write:
.myclass {
position:relative;
}
or
<img style="position:relative;" />
then you can control position by "top", "left", "right", "bottom" statement. Example:
<img src="position: relative; top: 20px;" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With