Jump to content
Sign in to follow this  
cerchris

Css selector for sidebar widget

Recommended Posts

cerchris

Hello

 

http://janetnicol.co.nz/?page_id=23

I have spent ages trying to find the css selector for the 2nd text widget in the universal sidebar. I am wanting to customise the heading for "news and updates", and fix the left hand dotted border so that I can fill in the gap between the "testimonials" and "news and updates" text-widgets

 

Thanks so much

 

Share this post


Link to post
Share on other sites
Rob

I don't believe there's a specific selector for each text widget.  However, you can certainly add a unique class to wrap the content you're adding to the widget.

 

Something like <div class="mywidget1">your content</div>

 

Then you can create your own CSS for it by adding

 

.mywidget1 {color:#C00000; } and so on. 


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
cerchris

I am using a "text" widget in a universal sideabar area and I tried adding <div class="mywidget1">your content</div> into the title section, but when I click save the html disappears. Where would I add the unique class you suggested above?

 

Also, From firebug I can see that the top sidebar widget is :
<li id="text-2" class="widget_text widget fix">

2nd widget is:
<li id="text-4" class="widget_text widget fix">

 

With text-2 and text-4, does that mean it is possible to find a unique selector for each?

Share this post


Link to post
Share on other sites
Rob

Yes, it does.  You'd add the code I provided inside the text area of the text widget. I'm sorry,  I did not realize it was the widget title.

 

I see this code in your CSS for that specific title:

 

#sb_universal .widget .widget-pad {
    background: url("
") repeat-y scroll left top transparent;
    margin-top: 40px;
    padding: 15px 20px 0 25px;
}

When I adjusted the margin-top to 2px, the dotted border above met up perfectly


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
cerchris

Yes I see that the 2px matches up the dotes - but that makes the heading for the first widget text "testimonials" sit to high and doesn't leave enough space between each textwidget.

 

My apologies - to be clear I am trying to find the individual css selectors for each textwidgets (as seen in the universal sidebar of this page http://janetnicol.co.nz/?page_id=23):
1- testimonials = li id="text-2"

2- news and updates = li id="text-4"

once I have this I can then change the icon next to the "news and updates" title, and should also be able to match up the dotes
if that isn't possible, is there somewhere else I can place the your suggested code - <div class="mywidget1">your content</div> this didn't work in the title section of that textwidget

Share this post


Link to post
Share on other sites
Danny

You have already answered your own question!

 

 

 

Also, From firebug I can see that the top sidebar widget is :

<li id="text-2" class="widget_text widget fix">

2nd widget is:
<li id="text-4" class="widget_text widget fix">

 

With text-2 and text-4, does that mean it is possible to find a unique selector for each?

 

Thats you answer right there, every text widget you add to your site will be given a unique ID, which can be used to add custom CSS to a particular widget.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
cerchris

oh I see that the hover state on those buttons is still working........

Share this post


Link to post
Share on other sites
Danny

Not sure what you mean in your reply, what does the hover state of buttons have to do with a text widget ID ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
cerchris

Oh god sorry I am confusing myself and you getting mixed up between 2 different posts I have going - the issue with the buttons relates to the other post.

 

As for this one, can you please give me the css selector for each of the text widgets? - seems I am very close by getting the text-2 and text-4 parts, but I tried and tried for ages in my css and couldn't get anything to affect the individual text widgets

Share this post


Link to post
Share on other sites
James B

You've got it already :-)

 

Its #text-2 and #text-4 they are the css id's you can use to affect those specific text widgets


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
cerchris

thanks so much you guys!! Problem solved

as usual it was simpler than what I was trying with my over complicated css.

Changed the individual text-wdget header and closed up the dotes with the correct spacing

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I have noticed that my primary sidebar becomes intermittently invisible when browsing through various blog articles on michaelkummer.com/blog.
      See:
      https://www.dropbox.com/s/z646sgoa3mfjl1j/Screenshot 2018-07-12 15.57.46.jpg?dl=0 and https://www.dropbox.com/s/vdledzzgginvwgv/Screenshot 2018-07-12 15.57.57.jpg?dl=0
      Upon refresh, the sidebar appears. I have been using the following CSS code to hide the sidebar on mobile without any issues. 
      @media only screen and (max-width: 993px) {
      /* hide sidebars */
           .plsb {
              display: none !important;
          }
      }
      I tried to add the following CSS to force the sidebar to show on screens that are wider than 994 pixels but to no avail. Any clue what could be causing this issue?
    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I am using the LESS/CSS Pagelines extension and tried to add the following code to make use of FontAwesome:
      a.c2a:before {
          content: "\f07a\00a0";
          font-family: "Font Awesome 5 Pro";
          Font-weight: 900;
          font-style: normal;
          font-weight: normal;
          text-decoration: inherit;
          padding-left: 4px;
      }
       
      The issue is that as soon as I have the CSS via the Custom Styling text box, Pagelines (or the extension) strips out the backslashes (\). As a result, I had to abandon the CSS/LESS extension and instead add all my CSS code to a separate .css file.
      Is there a fix or workaround for this?
      Thanks
      Michael
    • glyph.marketing
      By glyph.marketing+
      Hello, I am having a problem similar to that experienced by Michael Kummer here. We have pages that show this automatic scrolling issue (examples here and here) and it is sufficiently annoying that we have seen customers bounce while trying to convert. Strangely, it only happens at specific resolutions, so it can be difficult to reproduce. In general we can only consistently reproduce it on a 4k resolution with a browser width between 1517 and 1536px. 
      Thanks to Michael Kummer's help we were able to set the overflow-anchor property to none in the entire body, which fixed the issue as far as we can tell, but also obviously disabled scroll anchoring for the whole site. I tried applying it to the specific element that looked like it was being reloaded, which was the PL Meganav extension, but that was unsuccessful. 
      Can anyone help us figure out which element or ID we can apply this property to, so that we can fix the scrolling issue but not disable scroll anchoring for the entire site?
      Thank you - 
      Glyph Language Services
    • chamois_blanc
      By chamois_blanc+
      Hello,
      Shouldn't the image PL5 component be using the srcset/picture css directives to pick the correct size for an image? or it does already and I don't know how to use it? Thank you for any advice or enlightenment.
×