Solved

Styling style within a class

Posted on 2014-04-13
6
267 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
  • 4
  • 2
6 Comments
 
LVL 9

Author Comment

by:Rowby Goren
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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 add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now