Solved

Styling style within a class

Posted on 2014-04-13
6
268 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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 Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

912 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

19 Experts available now in Live!

Get 1:1 Help Now