Text and image in unordered list are overlapping - css

I want to move the text in this unordered list further to the right of my graphic, so they don't overlap. How do I do this?
Here's my code:
.page p { line-height: 1.2em; }
.page a { color: #1badd2; text-decoration: none; }
.widget li {
margin: 0;
padding: 2px 0px 8px 35px;
display: block; position: relative;
border-bottom: none;
}
.widget li:before {
content: '';
display: block;
background: url(http://bryancollins.eu/wp/wp-content/uploads/2014/04/arrow.png) no-repeat 0 0;
height: 12px; width: 30px;
position: absolute; top: 6px; left: 0px;
}
You can see it in action here: bryan.collins.eu/wp

You need to make room at the left by adding padding to the li element. The absolute positioning declared on the li:before selector causes it to be stacked above the li element.
Add this rule to this selector:
.featured-box ul li {
padding: 0 0 0 40px;
}
To vertically center the arrow a little more: Change the top value to 10px.
.widget li:before {
top: 10px;
}
Note: You could easily have added this as a background image on the li without using the :before selector.
.featured-box .widget li {
list-style: none;
background: url("http://bryancollins.eu/wp/wp-content/uploads/2014/04/arrow.png") no-repeat scroll 0 10px rgba(0, 0, 0, 0);
display: block;
margin: 0 0 0 30px;
padding: 0 0 0 40px;
}

Related

Break out of parent div

I am trying to get the the menu on the right side of the search bar to breakout of the parent.
Code: http://jsbin.com/xecolubodi/edit?html,css,js,output
I believe a modified to the following css styles is required:
.mapsearch-menu ul {
display: none;
position: relative;
top: -55px;
padding: 55px 0 0 0;
margin: 0;
user-select: none;
}
.mapsearch-menu ul:hover {
display: block;
}
.mapsearch-menu li {
background: white;
padding: 4px;
list-style: none;
border: 1px solid rgba(0, 0, 0, 0.298039);
margin-top: -1px;
}
.mapsearch-menu input[type=checkbox],
input[type=radio] {
vertical-align: middle;
position: relative;
bottom: 1px;
}
.mapsearch-menu li:hover {
background: #eee;
cursor: pointer;
}
.mapsearch-menu .button {
display: inline-block;
user-select: none;
cursor: pointer;
height: 16px;
width: 16px;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAJ0lEQVQ4y2NgGDbgJBD/JxGfQDbgOBkGHB1mYXBi6IfBmdEwIB8AAEQSURX+8q0jAAAAAElFTkSuQmCC");
}
.mapsearch-menu {
display: inline-block;
position: absolute;
top: 0;
right: 0;
margin-top: 12px;
padding-right: 5px;
}
Before click:
After click:
I want the hamburger menu icon to stay stationary and have the dropdown menu either breakout of the parent divs bounds or have the list items right justified.
I have been working on this for an hour and I am not getting anywhere. I tried various things (floating, etc).
ps: I prefer to have the search icon, the search text, and the hamburger all left-floated instead of the hack I am currently doing with padding with the search. If that is easier to fix that first then please attempt (I also been trying to fix that)
I updated your css below, It will probably work for you.
.mapsearch-menu ul {
display: none;
position: absolute; /* Add this you can change it as per you need */
top: -34px; /* Add this */
right:0px; /* Add this you can change it as per you need */
min-width:170px; /* Add this */
padding: 55px 0 0 0;
margin: 0;
user-select: none;
}
.mapsearch-menu .button {
display: inline-block;
user-select: none;
cursor: pointer;
position:relative; /* Add this */
height: 16px;
width: 16px;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAJ0lEQVQ4y2NgGDbgJBD/JxGfQDbgOBkGHB1mYXBi6IfBmdEwIB8AAEQSURX+8q0jAAAAAElFTkSuQmCC");
}
.mapsearch-menu li {
background: white;
padding: 4px;
list-style: none;
border: 1px solid rgba(0, 0, 0, 0.298039);
margin-top: -1px;
display:inline-block; /* Add this */
}

CSS list styling - how to reduce the distance between parent and children of the previous parent?

See the menu on the left: http://goo.gl/gV6B8D
I want to reduce or remove the ugly gap between the parent items and the children of the previous parent.
(I'll differentiate parent from children using different styling, so the parent-child structure is needed,
and that's how wordpress generates menus anyway).
How to do this?
CSS code:
.advanced-sidebar-menu ul {
background-color : #EDEDED;
}
.advanced-sidebar-menu ul li a {
display: block;
text-decoration: none;
color: black;
padding: 5px 15px 5px 15px;
background: ##EDEDED;
margin-left: 1px;
}
.advanced-sidebar-menu ul li {
border-bottom: 0px;
}
.advanced-sidebar-menu ul li a:hover { background: white; }
.widget-area .child-sidebar-menu, .widget-area .child-sidebar-menu li { padding : 0; margin : 0 0 15px 0; }
.widget-area .child-sidebar-menu li li { margin-bottom : 0; }
.widget-area .child-sidebar-menu a { margin : 0; }
.child-sidebar-menu * {
margin-left: 0 !important;
padding-left: 0 !important;
}
.child-sidebar-menu > li a {
padding-left: 20px !important;
}
.child-sidebar-menu li li a {
padding-left: 20px !important;
}
Change the margin on this line:
.widget-area .child-sidebar-menu, .widget-area .child-sidebar-menu li { padding : 0; margin : 0 0 15px 0; }
Just set it to margin: 0px;
That should fix your menu issue.

Hover links disappear before you can click them

I've created a drop down hover list in the UL tags using CSS, but before I can get the mouse down over the links, they disappear. How can I stop this?
This is my code:
#header {
margin: 0px;
padding: 0px;
width: 100%;
background-color: red;
height: 30px;
box-shadow:inset 0 1px rgba(255,255,255,0.3), inset 0 10px rgba(255,255,255,0.2), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);
text-align: center;
}
#header ul {
margin: 0px;
padding: 0px;
}
#header ul li {
display: inline;
text-align: center;
position: relative;
}
#header ul li a {
text-decoration: none;
font-size: 22px;
color: white;
font-weight: bold;
line-height: 30px;
margin-left: 10px;
}
#header ul ul {
position: absolute;
visibility: hidden;
top: 31px;
}
#header ul li:hover ul {
visibility: visible;
}
#header ul li a:hover {
text-decoration: underline;
font-size: 22px;
color: black;
}
Try adding height
#header ul li a{
text-decoration:none;
font-size:22px;
color:white;
font-weight:bold;
height:30px;
line-height:30px;
margin-left:10px;
}
Since your main menu is positioned at the very top of the page, it goes from 0 pixels to 30 pixels and you've left a 1 pixel gap before starting the submenu at 31 pixels. Either changing the main menu height to 31px or the top of the submenu to 30px should fix your problem.

Align an Icon and Feed Heading

I am trying to align an image with an , and I cannot get the heading to wrap around the image icon. I have a screen cap here: http://instagram.com/p/YNGBzrtAs8/
My CSS code is a mess because I keep trying everything, and it's getting messy. Here is the current mess state:
#deck-sub .news-feed { float: left; width: 90%; padding: 5%; margin: 0 0 15px 0; }
#deck-sub h1 { background: none; font: bold 2.0em Arial, Helvetica, sans-serif; color: #006586; margin: 0 0 -8px 0; }
#deck-sub .news-feed h2 a { color: #006586; text-decoration: none; font-size: 1.2em !important; margin: -33px 0 0 0;}
#deck-sub .news-feed ul {vertical-align: middle !important; background: none; padding: 5px 0 0 0; list-style: none; }
#deck-sub .news-feed ul li { vertical-align: middle !important; width: 100%; padding: 5px 0 5px 0; margin: 5px 0 0 0;}
#deck-sub .news-feed ul li a { vertical-align: middle !important; width: 100%; font: 0.8em/1.1em Arial, Helvetica, sans-serif; color: #555 !important; text-decoration: none; padding: 0px 0 0 0; margin: -5px 0 0 0; }
#deck-sub .news-feed ul li a:hover { background: none; color: #009fc7 !important; }
#deck-sub .new-feed ul li img { vertical-align: middle !important; }
#deck-sub .sfnewsListItem { vertical-align: middle !important; background: #ccc; }
#deck-sub .sfnewsMetaInfo { vertical-align: middle !important; padding: 0px; margin: 0px; background: #444;}
Any help would be greatly appreciated. I have run into this before, but my tricks are not working in this case. Thank you in advance.
I'm not sure what you mean by get the heading to wrap around...but I assume you want the image and the title to be beside eachother? vertical-align I don't believe works awesomely for this.
The best option is to remove the icon as an and instead put it into the CSS as a background image. Doing that gives you the ability to position it to the pixel.
It'd also let you sprite those two news\event icons into a single file to serve less resources.
http://www.w3schools.com/css/css_image_sprites.asp
Cheers!
Steve

CSS Aligning Sub Menu Center Wordpress

So basically I need to produce a menu like this in Wordpress:
Where the red bar is the width of the page and not fixed so can shrink with resize.
And the submenu is centred
I currently have:
And the CSS is:
#access {
clear: both;
display: block;
margin: 0 auto -10px;
width: 100%;
text-align:center;
}
#access ul {
font-size: 13px;
list-style: none;
margin: 0 0 0 -0.8125em;
margin-top: 0.3em;
padding-left: 0;
display:inline-block;
/*Font*/
letter-spacing:1px;
text-transform:uppercase;
color: #FFF;
}
#access li {
float: left;
position: relative;
}
#access a {
color: #eee;
display: block;
line-height: 2.333em;
margin: 0 1.2125em;
margin-bottom: 0.5em;
padding-top: 0.5em;
text-decoration: none;
/* Same colour as background */
border-bottom: 1px solid #000;
}
#access ul ul {
display: none;
position: inherit;
top: 0; left: 0;
margin: 0 auto;
width: 100%;
z-index: 9999;
float: left;
}
#access ul ul a {
color: #444;
font-size: 13px;
font-weight: normal;
height: auto;
line-height: 1.4em;
padding: 10px 10px;
display: inline-block;
}
#access ul ul li {
display: inline-block;
}
Any help
Check this jsfiddle created for you
I had defined a new division sub-menu-bg after the menu code and given a red background to it. Also i had edited your CSS to achieve correct horizontal drop-down menu.
Hope this will solve your problem.

Resources