Prevent wrapping of text below radio buttons - css

The best way I could describe what I want is with this picture:
How do I make it so the text aligns with the top text, and not the radio button?
Relevant CSS is as follows:
.basic-grey {
width: 600px;
margin-right: auto;
margin-left: auto;
background: #FFF;
word-wrap: break-word;
padding: 20px 30px 20px 30px;
font: 12px "Myriad Pro", sans-serif;
color: #888;
text-shadow: 1px 1px 1px #FFF;
border:1px solid #DADADA;
}
}
.basic-grey h1>span {
display: block;
font-size: 11px;
}
.basic-grey label {
display: block;
margin: 0px 0px 5px;
}
.basic-grey label>span {
float: left;
width: 80px;
text-align: right;
padding-right: 10px;
margin-top: 10px;
color: #888;
}
.basic-grey select {
background: #FFF url('down-arrow.png') no-repeat right;
background: #FFF url('down-arrow.png') no-repeat right);
appearance:none;
-webkit-appearance:none;
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
width: 72%;
height: 30px;
}
.basic-grey textarea{
height:100px;
}
.basic-grey p {
display: inline ;
}
;}
Markup:
<form name="frm1" action="index4.php" method="POST" class="basic-grey">
<h3>2. I have taught the course, several times face to face, that I wish to transform into a blended format. </h3>
<input type="radio" name="q2" value="1" /> <p>This statement accurately reflects my experience.</p><br>
<input type="radio" name="q2" value="2" /> <p>This statement partially reflects my experience (I have taught the course only a few times or once before).</p><br>
<input type="radio" name="q2" value="3" /> <p>This statement does not reflect my experience (this a new course that I will teach for the first time in a blended format).</p><br>
<br>
<input type="submit" name="button" class="button" value="Submit" />
</form>
When I try to float the radio button, all the text becomes out of whack.

It's pretty simple, just turn your label element to display: block; and use margin-left for the label and float your radio button to the left
Demo
Demo 2 (Nothing fancy, just used multiple radio for the demonstration)
input[type=radio] {
float: left;
}
label {
margin-left: 30px;
display: block;
}
Just note that say if you are storing the radio with the labels in an li element, something like
<ul class="radiolist">
<li>
<input type="radio"><label>Your text goes here</label>
</li>
</ul>
So make sure you self clear them by using something like
.radiolist li:after {
content: "";
clear: both;
display: table;
}
That will ensure that you are self clearing all the li elements, and about the :after psuedo, it is well supported in IE8 so nothing to worry about.

Flexbox solution:
Now that flexbox is widely supported, a simple display: flex; will work like magic.
Just wrap both the input and text with a <label> (so that clicking the text also toggles the input without the need for a for=""), and voila!
.flex-label {
display: flex;
}
input[type=radio] {
/* one way to help with spacing */
margin-right: 12px;
}
<label class="flex-label">
<input type="radio">
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </span>
</label>
If you want to keep the <label> separate, just wrap both in an element for applying the flex fix: https://jsfiddle.net/pn4qyam5/

This worked for me
input[type=radio] {
float: left;
display: block;
margin-top: 4px;
}
label {
margin-left: 15px;
display: block;
}

.basic-grey {
word-wrap: break-word;
font: 12px "Myriad Pro",sans-serif;
color: #888;
text-shadow: 1px 1px 1px #FFF;
}
.basic-grey p {
padding-left:20px;
}
.basic-grey input[type=radio] {
margin-left:-15px;
}
Assuming that your markup is:
<p><input type="radio"/>This statements actually...</p>

I love this:
HTML:
<input type="radio" name="vacation" value="Ski Trips"><label>very long label ...</label>
CSS:
input[type="radio"] {
position: absolute;
}
input[type="radio"] ~ label {
padding-left:1.4em;
display:inline-block;
}

Related

how to add tooltip for wordpress button?

I have tried with plugin its woking fine.
i need without plugin add some tooltip with css.
<div class="tooltip-text">Parent text
<span class="tooltiptext">Tooltip text here!</span>
</div>
styles:
.tooltip-box {
position: relative;
display: inline-block;
}
.tooltip-box .tooltip-text {
visibility: hidden;
width: 100px;
background-color: black;
color: #fff;
text-align: center;
padding: 6px 0;
position: absolute;
z-index: 1;
}
.tooltip-box:hover .tooltip-text {
visibility: visible;
}
if using some text contents it works fine.
now i m using buttons here
<div class="kt-btn-wrap kt-btn-wrap-2">
<a class="kt-button button kt-btn-2-action kt-btn-size-custom kt-btn-style-basic kt-
btn-svg-show-always kt-btn-has-text-true kt-btn-has-svg-false" >
<span class="kt-btn-inner-text">Tooltip Button</span>
</a></div></div>
if i use span class also didnt work. usual button style also changed. better solution suggest me Thank you
check this for button and text
.tooltip-text {
color:#000;
text-align: center;
padding: 6px 0;
position: absolute;
z-index: 1;
}
.tooltip-text .tooltiptext, .kt-btn-wrap .tooltiptext{visibility:hidden;}
.tooltip-text:hover .tooltiptext,
.kt-btn-wrap:hover span.tooltiptext{
visibility: visible;background-color: black;color:#fff;width:100%;
}
<div class="tooltip-text">Parent text
<span class="tooltiptext">Tooltip text here!</span>
</div><br><br>
<div class="kt-btn-wrap kt-btn-wrap-2">
<a class="kt-button button kt-btn-2-action kt-btn-size-custom kt-btn-style-basic kt-
btn-svg-show-always kt-btn-has-text-true kt-btn-has-svg-false" >
<span class="kt-btn-inner-text">Tooltip Button</span>
</a><span class="tooltiptext">Tooltip text here for button!</span></div>
Your actual code should work (granted you're fixing class names – your example code has some "deviations" ...).
Example 1
.kt-button {
position: relative;
display: inline-block;
}
.kt-btn-inline {
border: none;
appearance: none;
background-color: transparent;
padding: 0;
font-family: inherit;
font-size: inherit;
}
.kt-btn-inner-text,
.kt-btn-inner {
visibility: hidden;
width: 100px;
color: #fff;
text-align: center;
padding: 6px 0;
position: absolute;
z-index: 1;
}
.kt-btn-inner-text {
background-color: black;
color: #fff;
}
.kt-button:hover .kt-btn-inner {
visibility: visible;
}
<p>
<a class="kt-button button kt-btn-2-action kt-btn-size-custom kt-btn-style-basic kt-
btn-svg-show-always kt-btn-has-text-true kt-btn-has-svg-false">
Button Text (Link)
<span class="kt-btn-inner kt-btn-inner-text">Tooltip text</span>
</a>
</p>
<p>
<button class="kt-button kt-btn-inline button kt-btn-2-action kt-btn-size-custom kt-btn-style-basic kt-
btn-svg-show-always kt-btn-has-text-true kt-btn-has-svg-false">
Button Text (Button)
<span class="kt-btn-inner kt-btn-inner-text">Tooltip text</span>
</button>
</p>
<p>
<button class="kt-button kt-btn-inline button kt-btn-2-action kt-btn-size-custom kt-btn-style-basic kt-
btn-svg-show-always kt-btn-has-text-true kt-btn-has-svg-false">
Button image tooltip
<span class="kt-btn-inner"><img width="200" height="300" src="http://placekitten.com/g/200/300"></span>
</button>
</p>
So most likely there are some typos in your html or css.
The main concept is perfectly OK:
tooltip parent element has position:relative
tooltip text gets position: absolute and hidden visibility that's toggled on hover
Example 2: inlined tooltips
* {
box-sizing: border-box;
}
body {
font-family: "Segoe UI", sans-serif;
}
:root {
--border-radius: 0.3em;
--bg-color: rgba(0, 0, 0, 0.7);
--padding: 0.3em;
}
button {
appearance: none;
border: 1px solid #ccc;
padding: 0.3em;
font-size: 2em;
}
.layout {
width: 50%;
margin: 0 auto;
}
.tooltip {
position: relative;
}
span.tooltip {
font-weight: bold;
}
.tooltip-content:before {
content: "";
display: inline-block;
position: absolute;
border: var(--padding) solid transparent;
border-bottom-color: var(--bg-color);
top: calc((var(--padding) * 2 * -1));
left: 50%;
margin-left: calc(var(--padding) / 2 * -1);
border-radius: 0;
}
.tooltip-content {
position: absolute;
top: calc(100% - (var(--padding) * 2));
left: 50%;
z-index: 1;
visibility: hidden;
opacity: 0;
margin-top: calc(var(--padding) * 3);
transform: translateX(-50%);
display: block;
background-color: var(--bg-color);
width: calc(100% + var(--padding));
width: 100%;
min-width: 8em;
color: #fff;
text-align: center;
padding: var(--padding);
padding-top: calc(var(--padding) / 2);
border-radius: var(--border-radius);
transition: 0.3s;
font-size: 1rem;
line-height: 1.2rem;
vertical-align: baseline;
font-weight: normal;
}
.tooltip:hover .tooltip-content {
visibility: visible;
opacity: 1;
}
.tooltip-content-img {
padding: 0!important;
}
<div class="layout">
<button class="tooltip">Test button
<span class="tooltip-content">Tooltip text here!</span>
</button>
<p>Lorem ipsum dolor sit amet, <span class="tooltip">consectetuer adipiscing <span class="tooltip-content">Tooltip text here!</span></span> elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, <span class="tooltip">image <span class="tooltip-content tooltip-content-img"><img src="http://placekitten.com/g/200/300"></span></span> pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate</p>
</div>
Should work for any parent element. But you might have more specific css rules inherited by your theme or plugins (... uhm, wordpress). So you will need to inspect your computed styles in dev tools if you encounter any issues.

drop down effect for a html div on both mouse over and click

one of the answer in this question is using pure css approach:
HTML:
<div id="summary">Sample</div>
<div id="detail">Detail of this summary</div>
CSS:
> #summary:hover + #detail, #detail:hover { display: block; }
> #detail { display: none; }
my question is how can we include the click event where it is act like a on-off button?
Make the #summary div an anchor and add styles on it focus also.
#summary:hover+#detail,
#detail:hover {
display: block;
}
#detail {
display: none;
}
#summary:focus+#detail,
#detail:focus {
display: block;
}
<a id="summary" href="javascript:void(0);">Sample</a>
<div id="detail">Detail of this summary</div>
.summary:hover+.detail,
.detail:hover {
display: block;
}
.show.detail {
display: block;
}
.detail {
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="wrapper">
<a class="summary" href="javascript:void(0);">Sample1</a>
<div class="detail">Detail of this summary</div>
</div>
<div class="wrapper">
<a class="summary" href="javascript:void(0);">Sample2</a>
<div class="detail">Detail of this summary</div>
</div>
<div class="wrapper">
<a class="summary" href="javascript:void(0);">Sample3</a>
<div class="detail">Detail of this summary</div>
</div>
<script>
$(".summary").on("click", function() {
$(this).next().toggleClass("show");
})
</script>
CSS Solution
Use a checkbox and sync it to a label. The checkbox can be hidden so it appears that the label is the only button.
<input id='ID' type='checkbox' hidden>
<label for='ID'>Click the label the checkbox gets clicked as well</label>
label for attribute value must match the checkbox's id as demonstrated above.
Place the content below the checkbox. Set its max-height: 0; and overflow:hidden
<input id='ID' type='checkbox' hidden>
<label for='ID'>Click the label the checkbox gets clicked as well</label>
<article class='content'>...</article>
Set the following CSS ruleset:
#ID:checked + label + .content { max-height: 1000px}
The + is an Adjacent Sibling Combinator it basically targets the immediate sibling to the right or below a selector (basically the next element).
The demo follows the basic concept as described above, but there are more elements and transitions so be aware of positions and how they relate to the CSS when checkbox is :checked and when it isn't.
Demo
*,
*:before,
*:after {
margin: 0;
padding: 0
}
.menu {
margin: 20px auto;
visibility: hidden;
width: 92%;
}
.trigger {
visibility: visible;
}
.trigger label {
display: block;
min-height: 20px;
cursor: pointer;
border: 3px ridge crimson;
border-radius: 4px;
padding: 3px 0 0 5px;
}
.content {
max-height: 0;
overflow: hidden;
transition: all .75s;
}
img {
display: block;
margin: 5px 5px 0;
float: right;
}
#chx:checked+.menu .trigger,
.trigger:hover {
background: rgba(0, 0, 0, 0.8);
color: orangered;
}
#chx:checked+.menu .content,
.trigger:hover+.content {
max-height: 1000px;
transition: all .75s;
visibility: visible
}
<input id='chx' type='checkbox' hidden>
<figure class='menu'>
<figcaption class='trigger'>
<label for="chx">TRIGGER</label>
</figcaption>
<article class='content'>
<img src='https://yt3.ggpht.com/-7DsR5xtp9pM/AAAAAAAAAAI/AAAAAAAAAAA/nO22Um9xa28/s100-mo-c-c0xffffffff-rj-k-no/photo.jpg'>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</article>
</figure>
So you want to include the menu only on a click? I found a way to do it, only with a small amount of JavaScript:
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
.dropbtn {
background-color: #3498DB;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropbtn:hover, .dropbtn:focus {
background-color: #2980B9;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
overflow: auto;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown a:hover {background-color: #ddd;}
.show {display: block;}
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn">Dropdown</button>
<div id="myDropdown" class="dropdown-content">
Home
About
Contact
</div>
</div>
Put this into your page and it'll work.

only one link functioning in css only accordion

I am trying to show a CSS only vertical accordion inside a page having other things. Only the accordion is not showing properly - the las / bottom-most link opens the intended text - other links do not. But this same code works when written in a different HTML document having only the accordion.
I have gut feeling that the problem is in the CSS and about sizing or positioning (absolute / relative) - but cannot find it out.
Hope to get some light ...
My HTML and CSS are like below:
HTML:
<html>
<head>
<title>Test page</title>
<link rel="stylesheet" type="text/css" href="main1(with-accordion).css" media="screen">
</head>
<body>
<div id="header">
We do things to help you
<div id="inner_header">
to your satisfaction ....
</div>
</div>
<div id="nav">
<ul>
<li>
<input type="radio" name="tabs" checked id="tab1">
<label for="tab1">Who are we</label>
<div class="content">
<span>
Contents of tab1 goes here:
Visions etc.
</span>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab2">
<label for="tab2">What we do</label>
<div class="content">
<span>Contents of tab2 goes here:
Credentials, visions etc.
</span>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab3">
<label for="tab3">Contact us</label>
<div class="content">
<span>
Contents of tab3 goes here:
Contents etc.
</span>
</div>
<form method="post" id="data">
<fieldset > <legend> Data </legend>
<br>
<span class="inputs">
<label>First Name :</label>
<input type="text" name="First_Name" size="50">
</span>
<br>
<br>
<span class="inputs">
<label>Middle Name :</label>
<input type="text" name="Middle_Name" size="50">
</span>
<br>
<br>
<span class="inputs">
<label>Last Name :</label>
<input type="text" name="Last_Name" size="50">
</span>
<br>
<br>
<span class="inputs">
<label class="form_label">Address 1 : </label>
<input type="text" name="Address1" size="50">
</span>
<br>
<br>
<span class="inputs">
<label class="form_label">Address 2 :</label>
<input type="text" name="Address2" size="50">
</span>
<br>
<br>
<span class="inputs">
<label class="form_label">Pincode :</label>
<input type="text" name="pincode" size="20">
</span>
<br>
<br>
<span class="inputs">
<label class="form_label">Country :</label>
<select>
<option value="Afghanistan" title="Afghanistan">Afghanistan</option>
<option value="Åland Islands" title="Aland Islands">Aland Islands</option>
<option value="Albania" title="Albania">Albania</option>
<option value="Algeria" title="Algeria">Algeria</option>
<option value="American Samoa" title="American Samoa">American Samoa</option>
<option value="Andorra" title="Andorra">Andorra</option>
<option value="Angola" title="Angola">Angola</option>
<option value="Anguilla"
</select>
</span>
<br>
<br>
<span class="inputs">
<label class="form_label">Email ID :</label>
<input type="email" name="email" size="30">
</span>
<br>
<br>
</fieldset>
</form>
<input class="cancel_button" type="button" name="Cancel" value="Cancel">
<input class="submit_button" type="button" name="Submit" value="Submit">
</li>
</ul>
</div>
<!-- The following code block is the problem area-->
<div id="accordion">
<ul>
<li> Tab1</li>
<div id ="tab1" class="accordion-content">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
</div>
<li> Tab2</li>
<div id ="tab2" class="accordion-content">
Cum eu oporteat voluptatum, mandamus explicari ius eu. Discere
</div>
<li> Tab3</li>
<div id ="tab3" class="accordion-content">
No amet nullam detracto usu, vix posse iracundia deterruisset
</div>
<li> Tab4</li>
<div id ="tab4" class="accordion-content">
In a professional context it often happens that private or
</div>
</ul>
</div>
<!-- The above code block is the problem area-->
<div id="right_bar">Fixed contents here ... </div>
<div id="footer">Page created by: Sukalyan Ghoshal. Email:sukalayn_g#yahoo.com </div>
</body>
</html>
CSS:
#header {
position: absolute;
left: 0;
top: 0;
padding-top: 0;
height: 200px;
line-height: 250%; /**** This line is used to control spacing between the two lines in the header *****/
white-space: nowrap;
text-align: right;
font-size: 3em;
font-style: italic;
font-weight: bold;
color: navy;
width: 100%;
background: -webkit-linear-gradient (to right, mediumblue, darkturquoise);
background: -o-linear-gradient(to right, mediumblue, darkturquoise);
background: -moz-linear-gradient(to right, mediumblue, darkturquoise);
background: linear-gradient(to right, mediumblue, darkturquoise);
}
#inner_header {
display: block;
margin-top: 0;
line-height: 20%; /**** This line is also used to control spacing between the two lines in the header *****/
}
/*accordion css*/
#accordion {
position: absolute;
left: 0;
top: 200px;
}
#accordion ul {
position: relative;
top: 0;
list-style-type: none;
}
#accordion ul a {
display: block;
}
#accordion div {
display: none;
}
#accordion ul li + div:target {
display: inline-block;
margin-top: 10px;
}
.accordion-content {
width: 200px;
}
/* end of accordion css */
#nav {
position: absolute;
left: 225px;
top: 200px;
eight: 600px;
width: 775px;
border-style: solid;
border-width: 1px;
border-color: green;
}
#nav ul {
list-style-type: none;
}
#nav ul li {
display: inline-block; /******* Display property of the li must be set to inline-block along with that of the labels for showing labels side by side *****/
height: 30px;
}
#nav ul li input[type="radio"] {
display: none;
}
#nav ul li label {
float: left;
display:inline-block;
vertical-align: middle;
padding-top: 5px;
padding-bottom: -5px;
margin-bottom: -15px;
width: 125px;
height: 2.1em;
text-align: center;
font-size: 1em;
overflow: auto;
background-color: white;
border-style: solid;
border-width: 1px;
border-color: green;
border-top-right-radius: 5px;
border-top-left-radius: 5px;
border-bottom-width: 0;
line-height: 2.1em;
white-space: nowrap; /****** height=line-height with white-space=nowrap makes text inside an element vertically centered ********/
}
#nav div {
display: none;
position: absolute;
top: 56px;
left: 35px;
width: 700px;
height: 543px;
border-style: solid;
border-width: 1px;
border-color: green;
text-align: center;
}
#nav .content span {
vertical-align: middle;
}
/****** The next two block must be like this to the minimum to show a behaviour of tabs and tabbed content showing not to have a seperation between them ******/
#nav input[type="radio"]:checked ~ div {
display: block;
background-color: pink;
z-index: -1; /****The z-index property of the labels and the <div> element showing tab content must be staggered like this *****/
}
#nav input[type="radio"]:checked ~ label {
border-bottom-width: 0;
height: 2.2em; /*** In this particular design em has been used for height of labels for ease of toggling border between tab and content *****/
background-color: pink;
z-index: 2; /****The z-index property of the labels and the <div> element showing tab content must have staggered z-index like this *****/
}
/****** The previous two block must be like this to the minimum to show a behaviour of tabs and tabbed content showing not to have a seperation between them ******/
#data {
position: absolute;
left: 100px;
top: 100px;
width: 500px;
height: 550px;
display: none;
}
#nav input[id="tab3"]:checked ~ form > fieldset > .inputs {
position: relative;
left: 50px;
width: 100px;
}
#nav input[id="tab3"]:checked ~ form { /**** This styling is required for showing the form. Without this the fields in the form do not show up. *****/
display:inline-block;
}
#nav input[id="tab3"]:checked ~ form > fieldset {
position: absolute;
width: 565px;
left: -10px;
}
#nav input[id="tab3"]:checked ~ form > fieldset > .inputs > label {
display: block;
float: left;
margin: 0;
padding: 3px 13px 0 0;
text-align: right;
width: 140px;
background-color:pink;
border-width: 0;
}
#nav input[id="tab3"]:checked ~ form > fieldset > .inputs > input[type="text"] {
padding-top: -5px;
border:none;
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow:0 0 5px #666 inset;
-moz-box-shadow:0 0 5px #666 inset;
box-shadow:0 0 5px #666 inset;
height:25px;
line-height:25px;
width:200px;
text-indent:5px;
}
#nav input[id="tab3"]:checked ~ form > fieldset > .inputs > select {
padding-top: -5px;
border:none;
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow:0 0 5px #666 inset;
-moz-box-shadow:0 0 5px #666 inset;
box-shadow:0 0 5px #666 inset;
height:25px;
line-height:25px;
width:200px;
text-indent:5px;
}
#nav input[id="tab3"]:checked ~ form > fieldset > .inputs > input[type="email"] {
padding-top: -5px;
border:none;
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow:0 0 5px #666 inset;
-moz-box-shadow:0 0 5px #666 inset;
box-shadow:0 0 5px #666 inset;
height:25px;
line-height:25px;
width:200px;
text-indent:5px;
}
#nav input[id="tab3"]:checked ~ form > fieldset > .inputs > select {
width: 250px;
}
#nav input[id="tab3"]:not(:checked) ~ .cancel_button {
display: none;
}
#nav input[id="tab3"]:not(:checked) ~ .submit_button {
display: none;
}
#nav input[id="tab3"]:checked ~ .cancel_button {
position: absolute;
width: 100px;
left: 400px;
top: 540px;
height: 30px;
border-radius: 5px;
}
#nav input[id="tab3"]:checked ~ .submit_button {
position: absolute;
width: 100px;
left: 550px;
top: 540px;
height: 30px;
border-radius: 5px;
}
#right_bar {
position: absolute;
top: 200px;
left: 1002px;
height: 600px;
width: 340px;
border-style: solid;
border-color: orange;
}
#footer {
position:absolute;
left: 0;
top: 1200px;
width: 100%;
/*border-style: solid;
border-width: 1px;
border-color: black;*/
font-size: 1.25em;
font-style: italic;
font-weight: bold;
text-align: center;
color: white;
background-color: mediumorchid;
height: 100px; /***** The next three lines together vertically center the writing in the <div> ******/
line-height: 100px; /**** height and line-height must be same with white-space having a value of "nowrap" *****/
white-space: nowrap;
background: -webkit-linear-gradient (mediumorchid, violet);
background: -o-linear-gradient(mediumorchid, violet);
background: -moz-linear-gradient(mediumorchid, violet);
background: linear-gradient(mediumorchid, violet);
}
...Sorry for the long HTML and CSS ...
If you set multiple bookmarks with the same ID html never work, remember to set your code well or you'll never find the errors, also have left open many tags, (I've closed myself), click the JSFiddle link below for the correction .
The problem was in this part of code:
HTML
<div id="accordion">
<ul>
<li> Tab1</li>
<div id="tab10" class="accordion-content">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
</div>
<li> Tab2</li>
<div id="tab20" class="accordion-content">
Cum eu oporteat voluptatum, mandamus explicari ius eu. Discere
</div>
<li> Tab3</li>
<div id="tab30" class="accordion-content">
No amet nullam detracto usu, vix posse iracundia deterruisset
</div>
<li> Tab4</li>
<div id="tab40" class="accordion-content">
In a professional context it often happens that private or
</div>
</ul>
</div>
http://jsfiddle.net/Lsbeuv59/4/
I set hashtag with big characters to make sure the resolution of the problem in future cases

CSS inline element preventing hover

Using the following markup, I'm creating an image with two floated text overlays, one for the heading and one for the summary text. It's rendering how I wish and I'm able to use the entire image as well as the headline & summary to access the link except for the area immediately to the right of the 'headline' up to the end of the 'summary'. This happens in all browsers (except IE9 and lower). Any ideas why and how I can get around it?
HTML:
<div class="image">
<img src="Assets/Images/Picture.jpg" alt="Picture" />
<div class="overlay">
Headline
Summo eirmod appareat ex mel. Vim odio error labores ex. Mea alii abhorreant et. Ad has nominati constituam. Sit falli nominati suavitate in.
</div>
</div>
CSS:
body {
border: 0;
color: #5B6064;
font-family: Helvetica, Arial, Sans-Serif;
font-size: .75em;
line-height: 1.6em;
margin: 0;
padding: 0;
background-color: #a5a5a5;
}
a {
text-decoration: none;
color: #5B6064;
}
a:visited {
text-decoration: none;
}
img {
border: 0;
}
.image {
position: relative;
width: 100%;
/* For IE6 */
display: block;
overflow: hidden;
}
.overlay {
position: absolute;
bottom: 10px;
left: 0;
display: block;
}
.headline {
color: #FFF;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing: -1px;
background: #e87b10;
/* Fallback for older browsers */
background: rgba(232,123,16,0.8);
padding: 10px;
float: left;
clear: left;
}
.summary {
max-width: 350px;
margin-top: 3px;
color: #FFF;
font: 14px/14px Helvetica, Sans-Serif;
letter-spacing: 0;
background: #e87b10;
/* Fallback for older browsers */
background: rgba(232,123,16,0.8);
padding: 10px;
float: left;
clear: left;
}
.summary a {
color: #FFF;
}
I'd wrap the whole thing in an a tag (cleaner code). You would need to adjust a bit of your css.
EDIT
I changed the div elements to span so it is syntactically correct (thanks for the reminder Phrogz). Since your css already had display: block for the div elements, changing them to span is not an issue.
<a href="Default.aspx">
<span class="image">
<img src="Assets/Images/Picture.jpg" alt="Picture" />
<span class="overlay">
<span class="headline">Headline</span>
<span class="summary">Summo eirmod appareat ex mel. Vim odio error labores ex. Mea alii abhorreant et. Ad has nominati constituam. Sit falli nominati suavitate in.</span>
</span>
</span>
</a>
The headline is being floated left. If you remove the float and add display:block; to the anchor, it will take up the full image width.

Problem with CSS on Wordpress

I'm trying to code my sidebar.php but it breaks and goes all the way down below the posts
PHP:
<!-- begin sidebar -->
<div id="menu">
<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<label for="s">SEARCH</label>
<form id="searchform" method="get" action="#">
<div>
<input type="text" name="s" id="s" size="15" />
<br />
<input type="submit" value="TYPE HERE_" />
</div>
</form>
<div class="bg-sidebar">
<h2>MOST READ</h2>
<ul>
<li>Worth A Thousand Words</li>
<li>Feed Your Head</li>
<li>Aliquam tempus, eros commodo porta pretium</li>
<li>Pellentesque quis libero dui</li>
<li>Lorem ipsum dolor sit amet</li>
</ul>
<h2>RECENT POSTS</h2>
<ul>
<li>Worth A Thousand Words</li>
<li>Feed Your Head</li>
<li>Aliquam tempus, eros commodo porta pretium</li>
<li>Pellentesque quis libero dui</li>
<li>Lorem ipsum dolor sit amet</li>
</ul>
<h2>ARCHIVE</h2>
<ul>
<li>
<?php wp_get_archives('type=monthly'); ?>
</li>
</ul>
<h2>LINKS</h2>
<ul>
<li>t</li>
<li>tt</li>
</ul>
</div>
<?php endif; ?>
</div>
CSS:
* { margin: 0; padding: 0; }
body, input { font-family: "Trebuchet MS"; font-size: 12px; }
.move { clear: both; height: 0; float: none !important; }
body { background: url(images/bg.gif); width: 991px; position: absolute; top: 0; left: 50%; margin: 0 0 0 -495px; padding: 0 0 71px 0; }
a { text-decoration: none; }
li { list-style: none; }
img { border: 0; }
#searchform { float: left; width: 366px; height: 27px; }
#searchform * { float: left;}
#searchform label { width:75px; height: 26px; border: solid 1px #ab0000; border-width: 1px 1px 0 0; text-align: center; line-height: 25px; font-weight: bold; font-size: 18px; color: #ab0000; background: white; }
#searchform p { border-bottom: solid 1px #ab0000; width: 290px; height: 25px; }
#searchform input { border: 0; margin: 6px 0 0 10px; display: inline; width: 234px; font-weight: bold; color: #999999; background: transparent; outline: none; height: 16px; }
#searchform button { background: url(images/btn_vai.gif); width: 34px; height: 24px; border: 0; margin: 0 0 2px 0; float: right; }
#menu { width: 366px; height: 40px; float: left; margin: 1px 0 0 0; }
.bg-sidebar { background: white; width: 366px; padding: 50px 0 0 0; }
#menu h2 { color: #ab0000; font-size: 18px; line-height: 18px; padding: 0 0 10px 15px; }
#menu ul { border-top: solid 1px #d5d5d5; padding: 0 0 38px 0; }
#menu li { border-bottom: solid 1px #f3f2f2; line-height: 30px; font-size: 13px; font-weight: bold; padding: 0 0 0 24px; }
#menu li a { color: black; }
Can somebody help me out on this one?
Sidebars that fall below the content in Wordpress are often simply a missing closing </div> tag or two. Use the xhtml code validator at The W3C Markup Validation Service to look at your site and pages. Tick the box to "Show Source" in Options and you'll get a code listing that will point you to which of your theme files have problems. Compare a page with the correct sidebar placement and one that is broken.
Another reason the sidebar might be bumping down is that it's too wide to float-right within the space. I can't tell from the code you supplied but if the full width of the page is set to 966px and the sidebar is 366px, the main area content should be 600px (or less, depending on margins and padding). Try making the sidebar or main body content narrower.
If none of these suggestions work, I recommend posting a link to your page here. You'll get much better answers that way.
I faced the same problem. Once I cut down the body's width and the float element in the widget-area, mine got fixed. Also try to play around with the position elements in the CSS. Mine was fixed after a few tries.

Resources