Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Styling style within a class

Posted on 2014-04-13
6
Medium Priority
?
276 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 54

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 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

Independent Software Vendors: 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!

Question has a verified solution.

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

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…
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Suggested Courses

610 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