html - How can I have a div with an image with a white background floated left? -
my code in css is:
.logo{ content:url(http://www.dylionsrugby.com.au/wp-content/uploads/2012/04/lion.png/600x600); background-color: white; float: right; }
and in html have:
<div class="logo"></div>
am missing something, nothing appears?`
your question general. simulate right positioning using positioning property on image , not on div.
.logo{ width: 250px; height: 75px; background-image: url("http://www.slate.com/content/dam/slate/articles/health_and_science/science/2015/07/150730_sci_cecil_lion.jpg.crop.promo-xlarge2.jpg"); background-color: white; background-repeat: no-repeat; background-size: 100% 100%; float: right; }
<div class="logo"></div>
Comments
Post a Comment