HTML CSS examples for CSS Layout:Box
Parent Element Bounding Box Relative to Child Element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> ul.news {<!-- w w w.j ava 2s .c o m--> max-width:41%; float:right; } ul.news li { text-align:right; margin:0px 0px 11px 0px; background-color:Chartreuse; padding:8px; float:right; } a { color:yellow; } </style> </head> <body> <ul class="news"> <li> <a href="#">Lorem ipsum dolor s</a> </li> <li> <a href="#">Lorem ip</a> </li> </ul> </body> </html>