css - How can I align a div element in existing content -
i explain little example here:
i have html page content already, , without modifying content want insert some message (say inserting image) in middle of existing content leaving div @ top.
take @ picture, before doing css work:
http://i.stack.imgur.com/uhjbx.png
description: image inserted in content @ top of content div @ top
and after applying css, want place in between content, this:
http://i.stack.imgur.com/67yff.png
description: image inserted css aligned in middle of content div @ top
html:
<div class="myimg"> <img src=http://s14.postimg.org/miss2r3xt/html_css.jpg /> </div> <p>some paragraph </p> <strong>what html?</strong> <strong>what css?</strong> <p>some paragraph</p>
css:
.myimg { position: absolute; }
here link simple example, trying modify @ jsfiddle.
let me know if guys can help!!!
for adding elements css, take @ :after et :before.
for example, can add line css
strong:before{ content:url('http://s14.postimg.org/miss2r3xt/html_css.jpg'); }
Comments
Post a Comment