Currently I developing a registration form ... And I wish to include step by step for the user ... Code at the bottom I get from other site and I already modified some css ... however the element are showing in vertical ... What I need is horizontal ... I tried to position but it doesn't work ...
Currently Display
What I need
In HTML
<div class="steps">
<div id='genger' name='genger'/><label >Step 1</label></div>
<div id='genger' name='genger'/><label>Step 2</label></div>
<div id='genger' name='genger'/><label >Step 3</label></div>
<div id='genger' name='genger'/><label>Step 4</label></div>
<div id='genger' name='genger'/><label >Step 5</label></div>
</div>
In CSS
.steps{
width: 200px;
display:inline-block;
position: relative;
padding: 1em 2em 1em 3em;
vertical-align: top;
}
label{
background: #393D40;
height: 69px;
line-height: 69px;
width: 100%;
display: block;
border-bottom: 1px solid #44494e;
color: #889199;
text-transform: uppercase;
font-weight: 900;
font-size: 11px;
letter-spacing: 1px;
text-indent: 52px;
cursor: pointer;
transition: all 0.3s ease
}
label:before{
content:"";
width: 12px;
height: 12px;
border: 2px solid #25292e;
display: block;
position: absolute;
margin: 26px 0px 0px 18px;
border-radius: 100%;
transition: border 0.7s ease
}
label[for=genger]{
border-radius: 3px 3px 0px 0px;
}
label:hover{
background: #2B2E30;
color: #46b7e5
}
label:hover:before{
border: 2px solid #46b7e5;
}
Click for JSFiddle
Demo on Fiddle
HTML:
<div class="steps">
<div class='genger'>
<label>Step 1</label>
</div>
<div class='genger'>
<label>Step 2</label>
</div>
<div class='genger'>
<label>Step 3</label>
</div>
<div class='genger'>
<label>Step 4</label>
</div>
<div class='genger'>
<label>Step 5</label>
</div>
</div>
CSS:
.genger {
display: inline-block;
vertical-align: top;
margin: -1px;
}
.steps {
width: 100%;
display:inline-block;
position: relative;
vertical-align: top;
}
label {
background: #393D40;
height: 69px;
line-height: 69px;
width: 150px;
display: block;
border-bottom: 1px solid #44494e;
color: #889199;
text-transform: uppercase;
font-weight: 900;
font-size: 11px;
letter-spacing: 1px;
text-indent: 52px;
cursor: pointer;
transition: all 0.3s ease
}
label:before {
content:"";
width: 12px;
height: 12px;
border: 2px solid #25292e;
display: block;
position: absolute;
margin: 26px 0px 0px 18px;
border-radius: 100%;
transition: border 0.7s ease
}
label:hover {
background: #2B2E30;
color: #46b7e5
}
label:hover:before {
border: 2px solid #46b7e5;
}
First i have taken out your .steps width just removed the padding
you had also given your genger div codes as
<div id='genger' name='genger'/><label >Step 1</label></div>
you have closed the div before the label had started, I changed it to,
<div class='genger' name='genger'><label >Step 1</label></div>
also named your id genger to class
hence here is the final code...
#wrapper{
width:1200px;
margin:0 auto
}
.steps{
display:inline-block;
position: relative;
/*padding: 1em 2em;*/
vertical-align: top;
background:red;
width:100%;
}
.genger{
width:20%;
min-width:150px;
float:left;
}
label{
background: #393D40;
height: 69px;
line-height: 69px;
width: 100%;
display: block;
border-bottom: 1px solid #44494e;
color: #889199;
text-transform: uppercase;
font-weight: 900;
font-size: 11px;
letter-spacing: 1px;
text-indent: 52px;
cursor: pointer;
transition: all 0.3s ease
}
label:before{
content:"";
width: 12px;
height: 12px;
border: 2px solid #25292e;
display: block;
position: absolute;
margin: 26px 0px 0px 18px;
border-radius: 100%;
transition: border 0.7s ease
}
label[for=genger]{
border-radius: 3px 3px 0px 0px;
}
label:hover{
background: #2B2E30;
color: #46b7e5
}
label:hover:before{
border: 2px solid #46b7e5;
}
<div id="wrapper">
<div class="steps">
<div class='genger' name='genger'><label >Step 1</label></div>
<div class='genger' name='genger'><label>Step 2</label></div>
<div class='genger' name='genger'><label >Step 3</label></div>
<div class='genger' name='genger'><label>Step 4</label></div>
<div class='genger' name='genger'><label >Step 5</label></div>
</div>
<div>
Hope this helps.
P.S : you can center this menu as well . just wrap it inside a bigger div and give margin: 0 auto
EDIT:: If you want to be more flexible in your widths, you can add width:100% in the steps class and width 20% in genger class. See updated code snippet now
DEMO
check the demo, i have added in css
.steps {
width: 100%;
margin: 20px;
vertical-align: top;
}
.genger {float: left;width: 150px; }
Related
I am trying to display a particular div content with particular menu but my code is not showing like that. For the reference attached screenshot.(only with CSS). I don't want to use JS. When I am hovering on particular menu then all div content are displaying. And design is not looking good.
Here is my code:
<style>
.menu {
height: 24%;
width: 600px;
margin: auto;
border: 1px solid RGBA(0, 0, 0, 0.4);
font-family: calibri, monospace;
}
div.menu .button {
padding:5px 0px 5px 0px;
display:block;
cursor: pointer;
text-align:center;
width: 150px;
height: 50%;
background: #333;
border: 1px solid white;
color: #e7e7e7;
font-weight: 600;
}
div.menu .button:hover {
padding:5px 0px 5px 0px;
display:block;
cursor: pointer;
text-align:center;
width: 150px;
height: 50%;
background: #ff0000;
border: 1px solid white;
color: #e7e7e7;
font-weight: 600;
}
.menu .content {
position:absolute;
display:none;
width: 440px;
height: 23%;
margin-left: 155px;
border: 1px solid #e7e7e7;
}
.menu .content:hover {
left:150px;
top:0px;
color:black;
display:block;
}
.menu .button:hover:focus:active ~ div.content {
display: block;
}
html {
width: 100%;
height: 100%;
display: flex;
}
body {
display: flex;
margin: auto;
}
</style>
<body>
<div class="menu">
<div tabindex="0" class="button">Home</div>
<div class="content">
“A house is made of bricks and beams. A home is made of hopes and dreams. Home is where our story begins…”
</div>
<div tabindex="0" class="button">Contact</div>
<div class="content">
“Contacts added but not one is worthy enough to remain as their priority.”
</div>
<div tabindex="0" class="button">About</div>
<div class="content">
“To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.”
</div>
</div>
</body>
</html>
This is my image link.
Please try this,
.menu {
height: 24%;
width: 600px;
margin: auto;
border: 1px solid RGBA(0, 0, 0, 0.4);
font-family: calibri, monospace;
position:relative;
}
div.menu .button {
padding:5px 0px 5px 0px;
display:block;
cursor: pointer;
text-align:center;
width: 150px;
height: 50%;
background: #333;
border: 1px solid white;
color: #e7e7e7;
font-weight: 600;
}
div.menu .button:hover {
padding:5px 0px 5px 0px;
display:block;
cursor: pointer;
text-align:center;
width: 150px;
height: 50%;
background: #ff0000;
border: 1px solid white;
color: #e7e7e7;
font-weight: 600;
}
.menu .content {
position:absolute;
display:none;
width: 440px;
opacity:0;
margin-left: 155px;
border: 1px solid #e7e7e7;
}
.menu .button:hover+.content {
display: inline-block;
opacity:1;
transition:display 3s;
top:0;
}
html {
width: 100%;
height: 100%;
display: flex;
}
body {
display: flex;
margin: auto;
}
<body>
<div class="menu">
<div tabindex="0" class="button">Home</div>
<div class="content">
“A house is made of bricks and beams. A home is made of hopes and dreams. Home is where our story begins…”
</div>
<div tabindex="0" class="button">Contact</div>
<div class="content">
“Contacts added but not one is worthy enough to remain as their priority.”
</div>
<div tabindex="0" class="button">About</div>
<div class="content">
“To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.”
</div>
</div>
</body>
I have this problem on responsive I have this two text area
.row {
display: flex;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}
.col-md-12 {
flex: 0 0 100%;
max-width: 100%;
position: relative;
width: 100%;
padding-right: 15px;
padding-left: 15px;
}
.btn-group {
float: right;
display: inline-flex;
vertical-align: middle;
}
.form__group {
display: flex;
flex-direction: column-reverse;
}
.form__input {
height: 40px;
}
.horizontal-scroll {
white-space: nowrap;
overflow-x: auto;
}
.horizontal-scroll::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
height: 4px;
border: 1px solid rgba(0,0,0,.3);
border-radius: 4px;
z-index: 9999;
}
.horizontal-scroll::-webkit-scrollbar-thumb {
z-index: 9999;
border-radius: 4px;
height: 2px;
width: 4px;
background-color: rgba(0,0,0,.5);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}
}
}
.disabled-custom {
resize: none;
overflow-y: hidden;
background: #e4ebf8;
border: none;
cursor: default;
}
.form__input {
border: 1px solid #ccd4e3;
border-radius: 4px;
width: 100%;
margin: 0;
margin-bottom: 2.4rem;
padding: 1rem;
padding-top: 1.1rem;
transition: all 0.3s ease;
display: block;
font-family: inherit;
}
.form__label {
font-size: 14px;
color: #324161;
display: table-header-group;
transition: all 0.3s ease;
display: inline-block;
margin-bottom: 4px;
}
<div class="row">
<div class="col-md-12">
<div class="btn-group">
<div class="form__group" style=" margin-right: 24px;">
<textarea wrap="off" class="form__input disabled-custom horizontal-scroll" style="min-width: 600px;" readonly>https://app.zeplin.io/project/5bb1fdc046eb4d20e8405978/screen/5c18f75217aa3f24677c39a8</textarea>
<label class="form__label">aijsdoaisjdoiajsoidjais</label>
</div>
<div class="form__group">
<textarea wrap="off" class="form__input disabled-custom horizontal-scroll" style="min-width: 120px;" readonly>30 Points</textarea>
<label for="test_passing_sc" class="form__label">Test Passing Scoreasdasjdajsn</label>
</div>
</div>
</div>
</div>
The left text area with label included it has width of 600px min and the right 120px I managed when text longer for the left text area I put a horizontal scroll but for the right side i need when the text its longer to be able to auto width on the left side and the left text area to decrease width.. Can someone help me with this..?
<!Doctype html>
<style>
.row {
display: flex;
}
.col-md-12 {
max-width: 100%;
position: relative;
width: 100%;
padding-right: 15px;
padding-left: 15px;
}
.btn-group {
display: inline-flex;
vertical-align: middle;
}
.form__group {
display: flex;
flex-direction: column-reverse;
}
.form__input {
height: 40px;
}
.horizontal-scroll {
white-space: nowrap;
overflow-x: auto;
}
.horizontal-scroll::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
height: 4px;
border: 1px solid rgba(0, 0, 0, .3);
border-radius: 4px;
z-index: 9999;
}
.horizontal-scroll::-webkit-scrollbar-thumb {
z-index: 9999;
border-radius: 4px;
height: 2px;
width: 4px;
background-color: rgba(0, 0, 0, .5);
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}
.disabled-custom {
resize: none;
overflow-y: hidden;
background: #e4ebf8;
border: none;
cursor: default;
}
.form__input {
border: 1px solid #ccd4e3;
border-radius: 4px;
width: 100%;
margin: 0;
margin-bottom: 2.4rem;
padding: 1rem;
padding-top: 1.1rem;
transition: all 0.3s ease;
display: block;
font-family: inherit;
}
.form__label {
font-size: 14px;
color: #324161;
display: table-header-group;
transition: all 0.3s ease;
display: inline-block;
margin-bottom: 4px;
}
</style>
<body>
<div class="row">
<div class="col-md-12">
<div class="btn-group">
<div class="form__group" style="margin-right: 24px;">
<textarea wrap="off" class="form__input disabled-custom horizontal-scroll" style="min-width: 120px;" readonly>https://app.zeplin.io/project/5bb1fdc046eb4d20e8405978/screen/5c18f75217aa3f24677c39a8</textarea>
<label class="form__label">Input 1</label>
</div>
</div>
</div>
<div class="col-md-12">
<div class="btn-group">
<div class="form__group" style="margin-right: 24px;">
<textarea wrap="off" class="form__input disabled-custom horizontal-scroll" style="min-width: 120px;" readonly>30 Points</textarea>
<label for="test_passing_sc" class="form__label">Input 2</label>
</div>
</div>
</div>
</div>
</body>
</html>
This my code, I having problem with my css. I have added photo to describe my issue , i hope that make issue clear.
<div class="col-xs-12 col-sm-6 col-md-3" style="margin-top: 20px;">
<div class="col-item" >
<div class="post-img-content">
<img src="<?php echo $post['p_image']; ?>" style="width: 100%; height: 100%;" class="img-responsive" />
<span class="post-title">
<b class="pull-left"><?php echo $post['p_title']?></b>
</span>
</div>
<div>
<div class="info" >
<div class="row">
<div class="col-md-12"></div>
<div class="price col-md-6">
<h5><b><?php echo $post['p_category']?></b></h5>
</div>
<div class=" hidden-sm col-md-6">
<h5 style="text-align: right;"><b ><?php echo $post['u_name']?></b></h5>
</div>
<div class=" hidden-sm col-md-12">
<h5><b>Date : </b><?php echo $post['p_date']?></h5>
</div>
</div>
<div class="separator clear-left">
<p style="text-align: left;">
<i class="fa fa-eye"></i>View</p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>
</div>
and this is css i m using for above code
.col-item
{
border: 1px solid #E1E1E1;
border-radius: 10px;
background: #FFF;
}
.col-item:hover
{
box-shadow: 0px 2px 5px -1px #000;
-moz-box-shadow: 0px 2px 5px -1px #000;
-webkit-box-shadow: 0px 2px 5px -1px #000;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 10px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
border-bottom:2px solid #52A1D5;
}
.col-item .photo img
{
margin: 0 auto;
width: 100%;
padding: 1px;
border-radius: 10px 10px 0 0 ;
}
.col-item .info
{
padding: 10px;
border-radius: 0 0 5px 5px;
margin-top: 1px;
}
.col-item .price
{
/*width: 50%;*/
float: left;
margin-top: 5px;
}
.col-item .price h5
{
line-height: 20px;
margin: 0;
}
.price-text-color
{
color: #219FD1;
}
.col-item .separator
{
border-top: 1px solid #E1E1E1;
}
.clear-left
{
clear: left;
}
.col-item .separator p
{
line-height: 20px;
margin-bottom: 0;
margin-top: 10px;
text-align: center;
}
.col-item .separator p i
{
margin-right: 5px;
}
.col-item .btn-add
{
width: 50%;
float: left;
}
.col-item .btn-add
{
border-right: 1px solid #E1E1E1;
}
.col-item .btn-details
{
width: 50%;
float: left;
padding-left: 10px;
}
.controls
{
margin-top: 20px;
}
[data-slide="prev"]
{
margin-right: 10px;
}
/*
Hover the image
*/
.post-img-content
{
height: 196px;
position: relative;
}
.post-img-content img
{
position: absolute;
padding: 1px;
border-radius: 10px 10px 0 0 ;
}
.post-title{
display: table-cell;
vertical-align: bottom;
z-index: 2;
position: relative;
}
.post-title b{
background-color: rgba(51, 51, 51, 0.58);
display: inline-block;
margin-bottom: 5px;
margin-left: 2px;
color: #FFF;
padding: 10px 15px;
margin-top: 10px;
font-size: 12px;
}
.post-title b:first-child{
font-size: 14px;
}
.round-tag{
width: 60px;
height: 60px;
border-radius: 50% 50% 50% 0;
border: 4px solid #FFF;
background: #37A12B;
position: absolute;
bottom: 0px;
padding: 15px 6px;
font-size: 17px;
color: #FFF;
font-weight: bold;}
`this img when i put the mouse over div
i need help for this issue and i hope you guys help me.
How to make border of the button semi-transparent when positioning it on top of the image like so?
In CSS
.button { border: 5px solid rgba(2,4,233, 0.1); }
rgba() <- put your color, the last parameter is the opacity
Please update code codepen
.button {
width: 218px;
height: 57px;
background: #1abc9c;
position: absolute;
left: 50%;
top: 50%;
margin: -28px -109px;
line-height: 57px;
text-align: center;
color: #fff;
text-decoration: none;
font-size: 23px;
text-transform: uppercase;
border: 7px solid rgba(120,216,197,.5);
background-clip: padding-box;
display: none;
}
.image-holder{
display: inline-block;
vertical-align: top;
position: relative;
}
.image-holder img{
vertical-align: top;
}
.image-holder:hover .button{
display: block;
}
<div class="image-holder">
Go Ahead
<img src="http://lorempixel.com/400/200/city" alt="" />
</div>
I am learning HTML 5 and CSS3 and am having trouble with my tabbed navigation bar. I thought the li:active css stlye would achieve my goal but that only is upon click and doesn't stay that way. I have looked at many tutorials across the web and cannot find out how to do this with just CSS and HTML. I would like to avoid using javascript or php if possible. I have found information in a few places on "child" elements and using the z-index properties, and think this may be a possible solution, but do not understand how to implement them. They look how I want on hover, but I want them to stay that style when I click them to give the effect of an active tab. Any advice or help is greatly appreciated.
My HTML:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
Header
</header>
<nav>
<ul id="tabs">
<li>link1</li>
<li>link2</li>
<li>link3</li>
<li>link4</li>
</ul>
</nav>
<article>
Article of Content
</article>
<aside align="right">
Aside of Content
</aside>
<footer>
<span id="cpyrt">© 2013 Footer Content</span>
</footer>
</body>
</html>
MY CSS:
body {
top: 0;
width: 80%;
position: fixed;
margin-left: 10%;
margin-right: 10%;
box-shadow: #000 0px 0px 900px;
height: 100%;
}
header {
background-color: #06F;
height: 8%;
padding: 9px;
padding-top: 25px;
box-shadow: inset #000 0px 1px 2px;
}
nav{
background-color: #333;
box-shadow: inset #000 -10px -15px 50px;
float:left;
width: inherit;
height: 59px;
}
/*--------------Navigation Tabs Styling ----- START -----------------------------*/
nav li{
list-style-type: none;
display: inline-table;
background-color: #666;
padding-top:15px;
padding-left: 25px;
padding-right: 25px;
padding-bottom:7px;
border-top-left-radius:15px;
border-top-right-radius:15px;
text-align:center;
-webkit-transition: background-color 0.2s ease, color 0.1s linear, height 0.0s ease;
-moz-transition: background-color 0.2s ease, color 0.1s linear, height 0.0s ease;
-o-transition: background-color 0.2s ease, color 0.1s linear, height 0.0s ease;
box-shadow: #000 0px 1px 10px;
color: white;
}
nav li:hover{
list-style-type: none;
display: inline-table;
background-color:#09F;
padding-top:15px;
padding-left: 25px;
padding-right: 25px;
padding-bottom:7px;
border-top-left-radius:15px;
border-top-right-radius:15px;
color: black;
text-align:center;
box-shadow: inset #FFF 0px 1px 4px;
height: 30px;
margin-top: -3px;
}
nav li:active{
list-style-type: none;
display: inline-table;
background-color:#02F;
padding-top:15px;
padding-left: 25px;
padding-right: 25px;
padding-bottom:7px;
border-top-left-radius:15px;
border-top-right-radius:15px;
border:none;
}
/*--------------Navigation Tabs Styling ----- END -----------------------------*/
article{
padding: 5px;
float: left;
background-color: #ddd;
height: inherit;
width: inherit;
box-shadow: inset #000 0px 1px 2px;
}
aside{
top: auto;
padding: 10px;
position: fixed;
right: 10%;
background-color: #CCC;
width: 17%;
height: inherit;
float: right;
box-shadow: inset #000 0px 1px 2px;
}
footer {
position: fixed;
bottom: 0;
background-color: #06F;
width: inherit;
height:8%;
padding-top: 5px;
box-shadow: inset #000 0px 1px 2px;
margin-right: 15px;
}
:active only applies to anchors (<a>) and buttons (<button>, <input type="button/>...) and only while they are pressed.
You need to take a look at :target
http://jsfiddle.net/coma/ED6cH/6/
HTML
<div class="tabbed">
<a href="#dog" id="dog">
Dog
<div>
<p>This is a dog...</p>
</div>
</a>
<a href="#cat" id="cat">
Cat
<div>
<p>This is a cat...</p>
</div>
</a>
<a href="#foo" id="foo">
Foo
<div>
<p>This is a foo...</p>
</div>
</a>
</div>
CSS
div.tabbed {
position: relative;
font-size: 0;
}
div.tabbed > a {
display: inline-block;
padding: .5em;
font-size: 16px;
border-radius: 3px 3px 0 0;
background-color: #333;
color: #eee;
text-decoration: none;
line-height: 1em;
}
div.tabbed > a + a {
margin-left: .5em;
}
div.tabbed > a:target {
color: #333;
background-color: #eee;
}
div.tabbed > a > div {
position: absolute;
top: 100%;
left: 0;
width: 300px;
padding: .5em;
border-radius: 0 3px 3px 3px;
display: none;
color: #333;
background-color: #eee;
}
div.tabbed > a:target > div {
display: block;
}
The :target pseudo selector matches what's in the URL hash (http://foo.com#this_is_the_hash) with the element having that hash string as id.
There is another hackish method using transition with very long time:
http://joelb.me/blog/2012/maintaining-css-style-states-using-infinite-transition-delays/
Insane:
http://dabblet.com/gist/2076449