Solved

Styling style within a class

Posted on 2014-04-13
6
271 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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 …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

809 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