0

I have a bootstrap carousel that is used in one page. Right now, I have to use it in two or three more pages but in these cases the size has to be different from the first one. So if I use the css of the first carousel for all, all the modifications affects to all the carousels. So I can't manage them correctly. What is the best way to manage several carousels in a project with different size?

Thank you in advanced.

Levimatt
  • 453
  • 1
  • 11
  • 28

2 Answers2

0

What you could do is make the dimensions in percentages for example: width: 100% Then you could make the parent div the size you want.

Be carefull though, if you make the carousels defferent size you should watch the image dimension aswell, otherwise you could end up deforming the image (stretching).

NG.
  • 459
  • 1
  • 6
  • 20
0

The general idea in css is to define class for a global property and a id for a specific element. Can you just use #id selector in your case? I dont see a specific problem with angular.

If you want to overwrite css fromn your carroussel you can also define id selector plus !important for the sizes that you want

David Faure
  • 1,336
  • 14
  • 25
  • Could I use something like this? #carousel1 .item { ... } and then for another carousel #carousel2 .item { ... } ?? Is this correct? – Levimatt Nov 01 '15 at 10:14
  • http://stackoverflow.com/questions/1028248/how-to-combine-class-and-id-in-css-selector – David Faure Nov 01 '15 at 11:53