1

I am working on responsiveness of web page, for which I am using bootstrap. The web page consists of both images and text. I am able to make both of them responsive, but when I use

<img src="live_files/img_01.svg" class='img-responsive "stl_01"'>,

my image is falling on the text. To avoid this I am commenting my CSS.

Is there any way to resolve the problem without commenting my CSS?

Additionally, my images are not getting displayed when I am checking in iPad and iPhone. They only display when the images are in cache.

TylerH
  • 19,065
  • 49
  • 65
  • 86
Afreen
  • 81
  • 1
  • 10
  • where is your code, what you have tried yet, put it in fiddle – KesaVan Jul 09 '14 at 13:07
  • 3
    Welcome on SO. This is a Q/A site, not a place where magicians solve problem without seeing any code. Please [have the tour](http://stackoverflow.com/tour) and read the [How to ask](http://stackoverflow.com/help/how-to-ask) page – Laurent S. Jul 09 '14 at 13:08
  • 1
    `class='img-responsive "stl_01"'` selects the invalid class name: `.img-responsive."stl_01"`. I can not say this is causing your problems, but it is wrong anways: http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-selectors – Nico O Jul 09 '14 at 13:20
  • @NicoO Close, but not quite. It still selects `img-responsive`, but it fails to select the separate `stl_01` due to the additional quotes. Both are valid class names on their own, however. – TylerH Jul 09 '14 at 13:22
  • thanks for the clarification @TylerH. You are right. I just wanted to make an example of what Afreen is implicitly trying to do. – Nico O Jul 09 '14 at 13:24

1 Answers1

3

You cannot have multiple quotes in HTML class declarations. In order to declare multiple classes for an HTML element, simply add a space between two classes, like so:

<img src="live_files/img_01.svg" class="img-responsive stl_01">

The moment you add additional quotes (whether they are single or double quotes), anything after that within the class declaration is disregarded.

TylerH
  • 19,065
  • 49
  • 65
  • 86