Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am not able to delete the last part of the menu in Wordpress site of my client.
The original line of code is this:
ul # top-menu li {
padding-left: 19px;
background: url (images / menu-bg.png) no-repeat right 3px;
}
which CSS code should I use?
Its not smart to remove it like Fahad says, you can just remove the links in the menu.
Log in on the admin account of the site and go to:
From the 'Appearance' menu on the left-hand side of the Dashboard, select the 'Menus' option to bring up the Menu Editor.
Select the menu where the link is in, and remove it from that list. Save it, and you're done...
This should work:
ul#top-menu li:last-child
{
background: none;
}
This will remove the background image from the last menu item (in your case it will remove the line on the right).
EDIT: As ninja has pointed out, using last-child won't work on some versions of IE, so this method should work if you want to support them:
ul#top-menu > li + li + li + li + li + li + li + li
{
background: none;
}
This will remove the background from the 8th menu item (each li is referring to a menu item), you will need to remember to update this is you add/remove an items from the menu.
Since you haven't included any proper code and the website link which you've included opens up a coming soon page, I am not quite sure what you're referring to but from what I understand, you'd like to remove the last <li> present inside your menu. If yes, you can do that by setting the display property of the last <li> to none using the last-child psuedo-selector like this:
ul#top-menu li:last-child {
display: none;
}
UPDATE:
Since you've clarified that you want to remove the background image from the last <li>, you may use this CSS:
ul#top-menu li:last-child {
background: none;
}
If you want a solution which would work for older versions of IE then what you can do is that you can define a class for the last menu item by logging into your Wordpress Dashboard, navigating to Appearance>Menus, clicking on the screen options button in the top-right corner and placing a check on CSS classes. Next, scroll down, click to open the last menu item and type the class-name inside the CSS Classes (optional) input field. After saving the menu, you can set the background to none for the last menu item by targeting the CSS class which you set for it, like this (I've assumed the class-name of the last menu item to be last-menu-item):
ul#top-menu li.last-menu-item {
background: none;
}
Related
I just want to remove that blue underline from my donate button, its a Custom link i created after going to Appearance -> Menus -> Custom Link. The problem is this Custom link (donate button) is inheriting the same css from the navigation menu items, which i want to change. I have tried applying additional css,
.horizontal-navigation-bar nav ul li a:after {
margin-bottom: -1px;
}
but no success, any help shall be appreciated.
P.S. : - (I am working for the client, he has not given public access to the website, so sharing of url will be of no use), yes i am using UltraPress theme (https://justfreethemes.com/demo/?theme=UltraPress)
thanks
It seems it's just a matter of not targeting the right element, but since we can't see the code it's kind of hard to correct that.
Based on the template, this element, ul.navbar-nav>li.menu-item>a:after, controls the menu's underlines and the below css, when removed, removes the underline. So it should be something similar to this.
content: '';
display: block;
position: absolute;
bottom: -3px;
height: 2px;
Ideally, just inspect in your dev tools to find the exact element and style.
I am having trouble targeting a specific element. I'm trying to change the background color of a widget. My problem is this widget is used in a few spots on the site, so if I change something via CSS, it changes in all the widgets. I've been trying different selector combos via inspecting the element. I can't quite find the right one. The site is here http://titanpanama.com/newsite/ I'm trying to change the backgound-color of the list items under the heading Specials. I've tried
.specials-home .home-estate-widget .post-list li{ background-color:#000; }
I've tried adding a class to the container. Where am I going wrong?
To specifically target the list items in Specials widget, use this:
.specials-home ul.post-list li {
background: #000;
}
Try this:
div#my_poststypewidget-18 > .specials li {
background-color: gold;
}
It targets all children elements that are li in element with class .specials.
I'm using Wordpress>Atahualpa Theme>Recent Posts Widget Extended on my site toawaken.org.
Recent Posts are listed in the r.h. sidebar. I have added a "bullet" (disc) in front of each Post title. When I did so, it threw the spacing off.
If you link to my site, you will see for some reason the added bullet is forcing the text to appear one line below the bullet, instead of right next to it, on the same line as the bullet, as it should. I want the post's title to line up on the same line as the bullet, not one line below it. I tried adjusting margins/padding in the CSS editor, but no margin/padding combination changed this. Nor did changing the div list-style-position from inside to outside:
div.widget ul li {
display: list-item !important;
list-style: disc !important;
list-style-position: inside;
color: #2D85BA;
}
If anyone could please check the sidebar on my site and offer a remedy, would be much appreciated.
This plugin seems to have a clearfix implemented in the <li> elements, and it's pushing headers to the next line. You can override it with this CSS:
.rpwe-clearfix:before, .rpwe-clearfix:after {
content: none;
}
As a side note, try not to use so much !important expression in your stylesheets. You'll end up having more and more difficulties changing the CSS rules. If you want to everride certain rule, you use a selector with just a bit stronger specificity than the one you want to change.
You can read more about selectors' specificity here.
I have a pure CSS drop down menu that is working great but I want to have a drop down arrow on the parent menu items that have children to show the user the menu has choices/options. I have this currently:
/* drop down arror */
nav ul li > a:last-child:after { content: ' ▾'; }
This puts a drop down arrow next to EVERY menu item EXCEPT the ones with children. So what I need is an exact opposite to this. I wish there was an a:has-child or a:is-parent. Any one know how to do this without going the JavaScript route or image route?
Thanks in advance for your help to my question
Gosh, I was able to solve this just now using trial and error using the following code:
nav ul li > a:not(:last-child):after { content: ' ▾'; }
The thing about it is I had tried this originally and it didn't work.
nav ul li > a:not:last-child:after { content: ' ▾'; }
So the key is you have to use the parenthesis with the :not modifier which I was not aware. Basically the not operator did the "opposite" of what I had and poof it worked.
It looks like you already have a selection similar to what you want, it's just reversed. Try putting that arrow on every single item and then using the selector you created to hide it on those items it shouldn't show. The arrow will be left over on the items you couldn't select.
I'm afraid there is no method available at the moment to select the parent element via CSS.
If there was a way to do it, it would have been visible in the CSS selector specs:
CSS3 Selectors
I'd say that your options are to either asign different classes to the ul, e.g <ul class="parent"> and <ul class="sub-menu"> so you can select them in CSS, or target the parent elements via javascript
I'm trying to style navbar tabs. I have two pieces of code that work, but I need more control over the individual tabs and not sure how to do it.
These tabs are under the header and at the far right. And I'm trying to round the bottom left corner of only the first tab. The two code snippets below both round the bottom left of every tab in the nav bar.
I'd like to figure out the proper code that would give me control over each tab and allow me to style each tab individually. The 2 snippets below get me halfway there, just not sure which is better to be improved on or what to add.
.custom .menu, .custom .menu a, .custom .menu li ul {
-moz-border-radius-bottomleft:.5em; font-weight:bold;
-webkit-border-bottom-left-radius:.5em; font-weight:bold;
-moz-border-radius-bottomright:.0em;
-webkit-border-bottom-right-radius:.0em;}
Or this:
/* Remove the border from the far left. */
ul.menu{border-left:0;}
/* Add the left border back in. If you change the color of the nav border in the WordPress admin panel, you will also have to manually change the left border color below. */
ul.menu li.tab-1 a{
border-left:1px solid #CCC;
-moz-border-radius-topleft:.5em;
-webkit-border-top-left-radius:.5em;}
/* This creates the rounded borders. */
ul.menu li.tab a{
-moz-border-radius-bottomleft:.5em; font-weight:bold;
-webkit-border-bottom-left-radius:.5em; font-weight:bold;
-moz-border-radius-topright:.0em;
-webkit-border-top-right-radius:.0em;}
Thanks for any help
You might be over-engineering here - have you considered using the CSS :first-child pseudoclass? Failing that, how about rounding the bottom left of the <ul> rather than the first <li>? From what you've explained, both of these would achieve your desired results without writing a line of PHP.
What I would do since I generally have a php script of some sort generating the html, is when the html is generated give each tab its own style.
// Assume $menu_tabs contains tab names
echo "<ul>"
foreach($menu_tabs as $tab) {
$tabclass = tabclass($tab) // Just turn it into a valid css class name
echo "<li class='tab $tabclass'>$tab</li>"
}
echo "</ul>"
Or something to that effect.
Then you can just create a css style
.tabclassname {
// Special CSS goes here
}
Alternatively if you are not generating the tabs programmatically. You can just type in a name for each class manually.
EDIT: I mainly suggested PHP because you mentioned wanting control over all of your tabs. If you just want the first tab, then ul:first-child is a good method, or putting the rounding effect on ul as was suggested by Gavin