I’m try to wrap text around a image and I’m using an img class on my style sheet to do it. It’s loading the style sheet correctly and all the other style attributes are working correctly but the image. It works fine without codeigniter but for some reason if I add the class tag to the image in codeigniter the image does not show up.
code is below:
//CSS//
.imgWrap {
margin: 8;
float: left;
}
//html//
<img src="<?php echo base_url{'../images/image_1.jpg'); ?>"
alt ="landmark" class="imgWrap" />
Firstly,
base_url(), notbase_url{).Secondly, margins (and most other things in CSS) need units. Pixels (px), points (pt), picas (pc), even inches (in) if you desire. Have a look at http://www.w3schools.com/cssref/css_units.asp
Thirdly, for a good image wrap, you will want it positioned absolutely (perhaps relatively, depending on what you’re doing), give it a
display: block;and possibly explicitly define the width and height.