Solved

Styling style within a class

Posted on 2014-04-13
6
272 Views
Last Modified: 2014-04-13
Hello all,

I think this is the one issue with styling that I need to finally get straight in my brain.

I have a div class and then I have a class within it that needs to be styled.

Here's the HTML of the area in question:
<div class="uk-panel uk-panel-box FeaturedPicture">
<h3 class="uk-panel-title">Featured Picture</h3>
<style>
.mod-eventgallery-event .thumbnail{
float: left;
}
</style>
<div class="mod-eventgallery-event FeaturedPicture">
<div class="thumbnails">
<a class="thumbnail" href="/better-gallery/event/Saban">
<div style="clear:both"></div>
</div>
</div>
</div>

Open in new window


I want to control the div class "thumbnails" which is inside the div class="mod-eventgallery-event FeaturedPicture".

Basically there is an image in the thumbnails class that I need to either move to the right or, better yet, center.

In my next comment I'll provide the link to my development site with the specific issue that I am wrestling with.

Hopefully with your solution and explanation I'll finally get the logic worked out for me, not just for this specific issue, but handling it in the future.

Thanks

Rowby
0
Comment
Question by:Rowby Goren
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 9

Author Comment

by:Rowby Goren
ID: 39997484
Hello

Here's the link to development site:  test site

It's the image on the right, with the title "Pepperdine Tribute".

I tried this code and it didn't work.

  div.mod-eventgallery-event.FeaturedPicture thumbnails {
    
    margin-left: 20px;
  }

Open in new window


I assume I'm missing a period before the "thumbnails" ???

Your clarification on how to handle these very basic css things will hopefully help me beyond this site.

Thanks

Rowby
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39997502
You left out a period  .thumbnails
  div.mod-eventgallery-event.FeaturedPicture .thumbnails {
    
    margin-left: 20px;
  }

Open in new window


All you really need is
.thumbnails{
    text-align:center;
}

Open in new window

0
 
LVL 9

Author Comment

by:Rowby Goren
ID: 39997516
Hi

I tried

.thumbnails{
    text-align:center;
}

Open in new window


But in firebug bootstrap.css is taking control with (among other things)

 }
  .thumbnails {
    margin-left: -30px;
  }
  .thumbnails > li {
    margin-left: 30px;
  }

Open in new window


Your thoughts?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39997532
Because in the bootstrap.css file line 4182 adds the margin.  If that is your own code, get rid of it as you have it in your custom.css.  If that is bootstrap's css (I never noticed it) then use a different class name.

.thumbnails {
  margin-left: -20px;
  list-style: none;
  *zoom: 1;

Open in new window

0
 
LVL 9

Author Comment

by:Rowby Goren
ID: 39997569
Hi

I agree that it would be odd for bootstrap.css to have that margin at 4182.  I removed the margin from that bootstrap line it and now it's working fine.

Thanks!

Rowby
0
 
LVL 9

Author Closing Comment

by:Rowby Goren
ID: 39997571
Thanks!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS: How do I override in-line styling 11 32
Bootstrap list items overlap 3 38
Change color in a check box 8 16
toggle content 12 27
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question