I would like to put a button on 3 images. I made this:
I think my code is very long in my CSS? I often use the property left for each button, is it correct?
I think that I can delete .button_red_02 and .button_red_03?
In my HTML code I have ths:
<section id="contents">
<div class="background_red">Want to be updated with our offers and news?</div>
<div class="background_grey">
Read more +
<img src="https://zupimages.net/up/19/51/vn88.jpg" alt="" /></a>
Read more +
<img src="https://zupimages.net/up/19/51/9fik.jpg" alt="" /></a>
Read more +
<img src="https://zupimages.net/up/19/51/dwq9.jpg" alt="" /></a>
</div>
</section>
Then, in my CSS code I have this
.button_red_01{
background-color: #cd2122;
border: none;
color: white;
padding: 4px 15px 4px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
position: absolute;
left: -10px;
top: 150px;
z-index: 1;
font-size: 12px;
font-family: Open Sans;
}
.button_red_02{
background-color: #cd2122;
border: none;
color: white;
padding: 4px 15px 4px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
position: absolute;
left: 370px;
top: 150px;
z-index: 1;
font-size: 12px;
font-family: Open Sans;
}
.button_red_03{
background-color: #cd2122;
border: none;
color: white;
padding: 4px 15px 4px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
position: absolute;
right: 334px;
top: 150px;
z-index: 1;
font-size: 12px;
font-family: Open Sans;
}
#contents{
position:absolute;
display: block;
background-color: #CD2122;
top: 538px;
width: 100%;
height: 70px;
}
.background_red{
font-family: Open Sans, sans-serif;
font-size: 22px;
color: #fff;
margin: 17px 0px 17px 100px;
}
.background_grey{
display: block;
position: absolute;
top: 60px;
height: 80%;
margin-top: 48px;
left: 115px;
}
.background_grey img {
width: 30%;
border: 3px solid #BDB9B9;
margin:10px 16px 10px 0;
}
.button_red_01{
background-color: #cd2122;
border: none;
color: white;
padding: 4px 15px 4px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
position: absolute;
left: -10px;
top: 150px;
z-index: 1;
font-size: 12px;
font-family: Open Sans;
}
.button_red_02{
background-color: #cd2122;
border: none;
color: white;
padding: 4px 15px 4px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
position: absolute;
left: 370px;
top: 150px;
z-index: 1;
font-size: 12px;
font-family: Open Sans;
}
.button_red_03{
background-color: #cd2122;
border: none;
color: white;
padding: 4px 15px 4px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
position: absolute;
right: 334px;
top: 150px;
z-index: 1;
font-size: 12px;
font-family: Open Sans;
}
<section id="contents">
<div class="background_red">Want to be updated with our offers and news?</div>
<div class="background_grey">
Read more +
<img src="https://zupimages.net/up/19/51/vn88.jpg" alt="" /></a>
Read more +
<img src="https://zupimages.net/up/19/51/9fik.jpg" alt="" /></a>
Read more +
<img src="https://zupimages.net/up/19/51/dwq9.jpg" alt="" /></a>
</div>
</section>
As soon as you have the same CSS specifications for multiple objects, you can use classes and assign these to all of the objects required. In your example you do not need to have the same CSS for each button since all of them have mainly the same properties.
For the positioning I suggest to add unique IDs to each button to handle the positioning individually.
Note that each ID should only be used once (unique identifiers!) within your html template.
To select classed objects, use .classname, to select ID linked objects use #IDname.
Also since your browser reads your CSS file from top to bottom, you can change single properties for each button within its ID selector, for example
#button_red_01 {
background-color: blue;
}
For further insights on classes and IDs I highly recommend the MDN resource https://developer.mozilla.org/de/docs/Web/HTML/Globale_Attribute/class.
#contents{
position:absolute;
display: block;
background-color: #CD2122;
top: 538px;
width: 100%;
height: 70px;
}
.background_red{
font-family: Open Sans, sans-serif;
font-size: 22px;
color: #fff;
margin: 17px 0px 17px 100px;
}
.background_grey{
display: block;
position: absolute;
top: 60px;
height: 80%;
margin-top: 48px;
left: 115px;
}
.background_grey img {
width: 30%;
border: 3px solid #BDB9B9;
margin:10px 16px 10px 0;
}
.button {
background-color: #cd2122;
border: none;
color: white;
padding: 4px 15px 4px 15px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 12px;
cursor: pointer;
position: absolute;
z-index: 1;
font-size: 12px;
font-family: Open Sans;
}
#button_red_01 {
left: -10px;
top: 150px;
color: #2B28D8;
}
#button_red_02 {
left: 370px;
top: 150px;
}
#button_red_03 {
right: 334px;
top: 150px;
}
<section id="contents">
<div class="background_red">Want to be updated with our offers and news?</div>
<div class="background_grey">
Read more +
<img src="https://zupimages.net/up/19/51/vn88.jpg" alt="" /></a>
Read more +
<img src="https://zupimages.net/up/19/51/9fik.jpg" alt="" /></a>
Read more +
<img src="https://zupimages.net/up/19/51/dwq9.jpg" alt="" /></a>
</div>
</section>
Related
After creating my Header, I would like to put a Section with a paragraph but the problem is that I don't see my paragraph in my page.
Here is an example:
<section>
<p>test</p>
</section>
Why my Section is hidden? I forgot a step? I can solve my problem with the property: margin-top but I think it is not recommended.
Thank you for your help, I am a beginner.
Here is my code below
body{
margin: 0px;
padding: 0px;
}
header{
font-size: 11px;
font-weight: 700;
color: #777;
line-height: 20px;
}
.banner {
height: 550px;
width: 1366px;
position: absolute;
}
.transparent{
position: relative;
background-color: black;
opacity: 0.5;
height: 100px;
width: 1366px;
padding-top: 8px;
}
.page-left{
top: 1px;
color:white;
position: absolute;
display: inline-block;
left: 430px;
}
.page-left-languages{
top: 1px;
color:white;
position: absolute;
display: inline-block;
left: 515px;
}
.page-right{
top: 1px;
color:white;
position: absolute;
display: inline-block;
float: right;
right: 134px;
}
.page-right-login{
top: 1px;
color:white;
position: absolute;
display: inline-block;
float: right;
right: 80px;
}
nav{
position: absolute;
top: 44px;
float: right;
right: 92px;
}
nav ul{
list-style: none;
}
nav ul li{
display: inline-block;
font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
line-height: 27px;
}
nav ul li a{
padding: 8px 16px;
text-decoration: none;
color: #FFF;
text-decoration: center;
border-radius: 3px
}
nav ul li a:hover{
background-color: #FFF;
color: black;
}
.active{
background-color: #cd2122;
color: #FFF;
padding: 8px 16px;
border-radius: 3px;
}
.background-color-one{
position: absolute;
color: #fff;
font-size: 28px;
line-height: 1.3;
border-left: 5px solid #fff;
background-color: #000;
left: 20px;
bottom: 290px;
padding: 0px 15px 0px 15px;
}
.background-color-two{
position: absolute;
color: #fff;
font-size: 30px;
line-height: 1.3;
background-color: #000;
left: 20px;
bottom: 215px;
padding: 10px 10px 10px 10px;
}
.background-color-three{
position: absolute;
color: #fff;
font-size: 16px;
line-height: 1.3;
background-color: black;
opacity: 0.5;
left: 20px;
bottom: 180px;
}
<body>
<header>
<img class="banner" src="https://zupimages.net/up/20/13/5or2.jpg"/>
<div class="transparent"> </div>
<div class="page-left">Portfolio</div>
<div class="page-left-languages">Languages</div>
<div class="page-right">Support</div>
<div class="page-right-login">Login</div>
<nav>
<ul>
<li><a class="active"><href="#">Home</a></li>
<li> Plan</li>
<li>Commission</li>
<li>About us</li>
<li>Features</li>
<li>Register</li>
<li>Pages</li>
<li>Contact us</li>
</ul>
</nav>
<div class="background-color-one">7.6%-18% daily for 16 days</div>
<div class="background-color-two">Min deposit $10-Max deposit $50,000</div>
<div class="background-color-three">We accept Perfectmoney,Payeer and Bitcoin</div>
</header>
<section>
<p>test</p>
</section>
</body>
Simpler to give your body a background-image. Use flex-box for your navigation. It makes things simple.
html {
height: 100%;
}
body {
margin: 0px;
padding: 0px;
min-height: 100%;
background: #000 url('https://zupimages.net/up/20/13/5or2.jpg') no-repeat center center scroll;
background-size: cover;
}
header {
font-size: 11px;
font-weight: 700;
color: #777;
padding: 1rem;
margin: 0 0 2rem;
background-color: rgba(0, 0, 0, 0.5);
}
#nav-secondary {
display: flex;
justify-content: space-between;
}
nav ul {
list-style: none;
margin: 0.5rem;
padding: 0;
}
nav ul li {
display: inline-block;
font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
}
nav ul li a {
padding: 8px 16px;
text-decoration: none;
color: #FFF;
text-decoration: center;
border-radius: 3px;
display: inline-block;
}
nav ul li a:hover {
background-color: #FFF;
color: black;
}
.active {
background-color: #cd2122;
color: #FFF;
padding: 8px 16px;
border-radius: 3px;
}
main {
padding: 1rem;
}
.background-color-one {
color: #fff;
font-size: 28px;
line-height: 1.3;
border-left: 5px solid #fff;
background-color: #000;
padding: 0px 15px 0px 15px;
margin-bottom: 30px;
}
.background-color-two {
color: #fff;
font-size: 30px;
line-height: 1.3;
background-color: #000;
padding: 10px 10px 10px 10px;
margin-bottom: 30px;
}
.background-color-three {
color: #fff;
font-size: 16px;
line-height: 1.3;
background-color: #000;
padding: 10px 10px 10px 10px;
opacity: 0.5;
}
<body>
<header>
<nav id="nav-secondary">
<ul class="nav-secondary-left-list">
<li><a class="active" href="#">Portfolio</a></li>
<li>Languages</li>
</ul>
<ul class="nav-secondary-right-list">
<li>Support</li>
<li>Login</li>
</ul>
</nav>
<nav id="nav-primary">
<ul>
<li><a class="active" href="#">Home</a></li>
<li> Plan</li>
<li>Commission</li>
<li>About us</li>
<li>Features</li>
<li>Register</li>
<li>Pages</li>
<li>Contact us</li>
</ul>
</nav>
</header>
<main>
<section>
<div class="background-color-one">7.6%-18% daily for 16 days</div>
<div class="background-color-two">Min deposit $10-Max deposit $50,000</div>
<div class="background-color-three">We accept Perfectmoney,Payeer and Bitcoin</div>
</section>
<section>
<p>test</p>
</section>
</main>
</body>
Your image is positioned absolutely and "in front of" your section. There are more elegant ways to use an image as a background, like using a CSS-background-image on your body.
But using your code, it would be a quick fix to give your image a negative z-index, so that it steps behind your section:
body{
margin: 0px;
padding: 0px;
}
header{
font-size: 11px;
font-weight: 700;
color: #777;
line-height: 20px;
}
.banner {
height: 550px;
width: 1366px;
position: absolute;
z-index: -1; /* added */
}
.transparent{
position: relative;
background-color: black;
opacity: 0.5;
height: 100px;
width: 1366px;
padding-top: 8px;
}
.page-left{
top: 1px;
color:white;
position: absolute;
display: inline-block;
left: 430px;
}
.page-left-languages{
top: 1px;
color:white;
position: absolute;
display: inline-block;
left: 515px;
}
.page-right{
top: 1px;
color:white;
position: absolute;
display: inline-block;
float: right;
right: 134px;
}
.page-right-login{
top: 1px;
color:white;
position: absolute;
display: inline-block;
float: right;
right: 80px;
}
nav{
position: absolute;
top: 44px;
float: right;
right: 92px;
}
nav ul{
list-style: none;
}
nav ul li{
display: inline-block;
font-family: "Lato","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
line-height: 27px;
}
nav ul li a{
padding: 8px 16px;
text-decoration: none;
color: #FFF;
text-decoration: center;
border-radius: 3px
}
nav ul li a:hover{
background-color: #FFF;
color: black;
}
.active{
background-color: #cd2122;
color: #FFF;
padding: 8px 16px;
border-radius: 3px;
}
.background-color-one{
position: absolute;
color: #fff;
font-size: 28px;
line-height: 1.3;
border-left: 5px solid #fff;
background-color: #000;
left: 20px;
bottom: 290px;
padding: 0px 15px 0px 15px;
}
.background-color-two{
position: absolute;
color: #fff;
font-size: 30px;
line-height: 1.3;
background-color: #000;
left: 20px;
bottom: 215px;
padding: 10px 10px 10px 10px;
}
.background-color-three{
position: absolute;
color: #fff;
font-size: 16px;
line-height: 1.3;
background-color: black;
opacity: 0.5;
left: 20px;
bottom: 180px;
}
<body>
<header>
<img class="banner" src="https://zupimages.net/up/20/13/5or2.jpg"/>
<div class="transparent"> </div>
<div class="page-left">Portfolio</div>
<div class="page-left-languages">Languages</div>
<div class="page-right">Support</div>
<div class="page-right-login">Login</div>
<nav>
<ul>
<li><a class="active"><href="#">Home</a></li>
<li> Plan</li>
<li>Commission</li>
<li>About us</li>
<li>Features</li>
<li>Register</li>
<li>Pages</li>
<li>Contact us</li>
</ul>
</nav>
<div class="background-color-one">7.6%-18% daily for 16 days</div>
<div class="background-color-two">Min deposit $10-Max deposit $50,000</div>
<div class="background-color-three">We accept Perfectmoney,Payeer and Bitcoin</div>
</header>
<section>
<p>test</p>
</section>
</body>
I would like to give specific color font when I mouse over.
<div className="actions" className="icon"><div><span></span>trailer</div></div>
I tried but didn't work. Is there another way than :hover??
.icon:hover , .actions:hover{
color : #FF382E;
}
.actions{
position: absolute;
right: 20px;
top: 20px;
}
.icon{
float: right;
width: 50px;
height: 14px;
padding: 30px 0 10px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border: 1px solid #E0E0E0;
text-align: center;
font-size: 13px;
color: #93939c;
position: relative;
cursor: pointer;
}
The hover part is fine, the only problem is that :hover targets the element being hovered by default. You can adapt your css to target the element more specifically:
.icon:hover , .actions:hover div a{
color : #FF382E;
}
.actions{
position: absolute;
right: 20px;
top: 20px;
}
.icon{
float: right;
width: 50px;
height: 14px;
padding: 30px 0 10px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border: 1px solid #E0E0E0;
text-align: center;
font-size: 13px;
color: #93939c;
position: relative;
cursor: pointer;
}
<div class="actions" class="icon">
<div>
<span></span>
trailer
</div>
</div>
Done some changes and updated your code.
.icon:hover a {
color: #FF382E;
}
.actions {
position: absolute;
right: 20px;
top: 20px;
}
.icon {
float: right;
width: 50px;
height: 14px;
padding: 30px 0 10px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border: 1px solid #E0E0E0;
text-align: center;
font-size: 13px;
color: #93939c;
position: relative;
cursor: pointer;
}
<div class="actions icon">
<div><span></span>trailer</div>
</div>
JS Fiddle
I am developing a chat application. In that chat message box I need to show a message, the user's name, current date and time. I am showing all those things except time and date UI is not looking good.
.userTextDivOp {
text-align: left;
float: left;
clear: both;
position: relative;
background: white;
padding-top: 5px;
padding-bottom: 7px;
padding-left: 7px;
padding-right: 7px;
border-radius: 6px;
border: 3px solid #999;
font-size: 12px;
margin-bottom: 7px;
margin-right: 4px;
margin-left: 4px;
}
.userTextDivOp::before {
content: '';
position: absolute;
visibility: visible;
top: -3px;
left: -11px;
border: 9px solid transparent;
border-top: 11px solid #999;
}
.userTextDivOp::after {
content: '';
position: absolute;
visibility: visible;
top: 0px;
left: -6px;
border: 9px solid transparent;
border-top: 8px solid white;
clear: both;
}
.userTextDivOp .message {
word-break: break-all;
font-size: 13px;
}
.userTextDivOp .username {
position: relative;
display: block;
font-weight: bold;
font-size: 14px;
color: #8e0035;
text-align: left;
padding-bottom: 4px;
margin-top: 3px;
}
.userTextDivOp .time {
position: absolute;
font-size: 14px;
color: #f60;
text-align: right;
}
<div class="userTextDivOp">
<span class="username">UserName</span>
<span class="message">' Testing testing</span>
<span class="time">04:00 PM 7 Jul 2016</span>
</div>
.userTextDivOp {
text-align: left;
float: left;
clear: both;
position: relative;
background: white;
padding-top: 5px;
padding-bottom: 40px;
padding-left: 7px;
padding-right: 7px;
border-radius: 6px;
border: 3px solid #999;
font-size: 12px;
margin-bottom: 7px;
margin-right: 4px;
margin-left: 4px;
}
.userTextDivOp::before {
content: '';
position: absolute;
visibility: visible;
top: -3px;
left: -11px;
border: 9px solid transparent;
border-top: 11px solid #999;
}
.userTextDivOp::after {
content: '';
position: absolute;
visibility: visible;
top: 0px;
left: -6px;
border: 9px solid transparent;
border-top: 8px solid white;
clear: both;
}
.userTextDivOp .message {
word-break: break-all;
font-size: 13px;
}
.userTextDivOp .username {
position: relative;
display: block;
font-weight: bold;
font-size: 14px;
color: #8e0035;
text-align:left;
padding-bottom: 4px;
margin-top: 3px;
}
.userTextDivOp .time {
position: absolute;
font-size: 14px;
color: #f60;
}
<div class="userTextDivOp" >
<span class="username">UserName</span>
<span class="message">' Testing testing</span>
<span class="time">04:00 PM 7 Jul 2016</span>
</div>
You can use the time class to define the span you want to change.
.userTextDivOp {
text-align: left;
float: left;
clear: both;
position: relative;
background: white;
padding-top: 5px;
padding-bottom: 7px;
padding-left: 7px;
padding-right: 7px;
border-radius: 6px;
border: 3px solid #999;
font-size: 12px;
margin-bottom: 7px;
margin-right: 4px;
margin-left: 4px;
}
.userTextDivOp::before {
content: '';
position: absolute;
visibility: visible;
top: -3px;
left: -11px;
border: 9px solid transparent;
border-top: 11px solid #999;
}
.userTextDivOp::after {
content: '';
position: absolute;
visibility: visible;
top: 0px;
left: -6px;
border: 9px solid transparent;
border-top: 8px solid white;
clear: both;
}
.userTextDivOp .message {
word-break: break-all;
font-size: 13px;
}
.userTextDivOp .username {
position: relative;
display: block;
font-weight: bold;
font-size: 14px;
color: #8e0035;
text-align:left;
padding-bottom: 4px;
margin-top: 3px;
}
.userTextDivOp .time {
//#You can edit these style settings to edit how the Time and date look
position: relative;
font-size: 14px;
color: pink;
padding: 0 20px;
font-family: courier, monospace;
}
<div class="userTextDivOp" >
<span class="username">UserName</span>
<span class="message">' Testing testing</span>
<span class="time">04:00 PM 7 Jul 2016</span>
</div>
Well, One thing You can do, like facebook ; You can make the time visible when someone hovers the chat message.
JS FIDDLE
HTML:
<div class="wrapper">
<div class="userTextDivOp" >
<span class="username">UserName</span>
<span class="message">' Testing testing</span>
<span class="time">04:00 PM 7 Jul 2016</span>
</div>
</div>
.wrapper{
position: relative;
}
.userTextDivOp {
text-align: left;
float: left;
clear: both;
background: white;
padding-top: 5px;
padding-bottom: 7px;
padding-left: 7px;
padding-right: 7px;
border-radius: 6px;
border: 3px solid #999;
font-size: 12px;
margin-top: -3px;
margin-left: -2px;
cursor:pointer;
}
.userTextDivOp .time {
position: absolute;
font-size: 14px;
color: #f60;
left: 125px;
top: 0;
visibility:hidden;
}
.userTextDivOp:hover .time {
visibility:visible;
}
.userTextDivOp::before {
content: '';
position: absolute;
visibility: visible;
top: -3px;
left: -11px;
border: 9px solid transparent;
border-top: 11px solid #999;
}
.userTextDivOp::after {
content: '';
position: absolute;
visibility: visible;
top: 0px;
left: -6px;
border: 9px solid transparent;
border-top: 8px solid white;
clear: both;
}
.userTextDivOp .message {
word-break: break-all;
font-size: 13px;
}
.userTextDivOp .username {
position: relative;
display: block;
font-weight: bold;
font-size: 14px;
color: #8e0035;
text-align:left;
padding-bottom: 4px;
margin-top: 3px;
}
Isnpite of using You can use the tag with datetime attribute , Time is just an HTML tag. Here's a simple example that represents November 2011:
<time> 2011-11 </time>
And The datetime attribute is what makes the time element unique. It represents the date, time, or duration for whatever text you are representing in a machine readable format. That means it is for computers, not humans, so it has very specific formats.
It's probably a bit more common for the human-readable version to be just a textual representation of the datetime:
<time datetime="2011-11">November, 2011</time>
<time datetime="2013-04-01">April 1st, 2013</time>
<time datetime="5d 22h 54m 41s">5 days, 22 hours, 54 minutes, and 41 seconds</time>
Please help to vertically align the tittle.
It seems not working properly.
<html>
<body>
<head>
<style type="text/css">
html *
{
margin: 0px;
padding: 0px;}
.Title
{
width: 50%;
display:inline-block;
vertical-align:middle;
text-align: center;
font-weight: bold;
font-size: larger;
border: solid;
border-width: thin;
}
.btn{
color:white;
background-color:#8CC152;
margin: 0px !important;
width: auto;
display: inline-block;
padding: 6px 12px;
margin-bottom: 0px;
font-size: 14px;
font-weight: 400;
line-height: 1.42857;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
-moz-user-select: none;
background-image: none;
border: 1px solid transparent;
}
.btn:hover{
background-color:#A0D468;
}
.btn-next{
border-radius: 4px;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
float:right;
}
.btn-prev{
border-radius: 4px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
float:left;
}
</style>
</head>
<div class='Title'>
<p>
This is a title
<a href='?m=1'><span class='btn btn-prev'>LEFT</span></a>
<a href='?m=2'><span class='btn btn-next'>RIGHT</span></a>
</p>
</div>
</body>
</html>
Set a line-height for the paragraph
p {
line-height: 32px;
vertical-align: middle;
}
p {
line-height: 32px;
vertical-align: middle;
}
<head>
<style type="text/css">
html * {
margin: 0px;
padding: 0px;
}
.Title {
width: 50%;
display: inline-block;
vertical-align: middle;
text-align: center;
font-weight: bold;
font-size: larger;
border: solid;
border-width: thin;
}
.btn {
color: white;
background-color: #8CC152;
margin: 0px !important;
width: auto;
display: inline-block;
padding: 6px 12px;
margin-bottom: 0px;
font-size: 14px;
font-weight: 400;
line-height: 1.42857;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
-moz-user-select: none;
background-image: none;
border: 1px solid transparent;
}
.btn:hover {
background-color: #A0D468;
}
.btn-next {
border-radius: 4px;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
float: right;
}
.btn-prev {
border-radius: 4px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
float: left;
}
</style>
</head>
<div class='Title'>
<p>
This is a title
<a href='?m=1'><span class='btn btn-prev'>LEFT</span></a>
<a href='?m=2'><span class='btn btn-next'>RIGHT</span></a>
</p>
</div>
</body>
</html>
.
Here is my link http://jsfiddle.net/ashadee/xhaLqvav/.
Html code
Eat your lunch<br>
CSS
a{
font-size: 1.2em;
white-space: normal;
}
a.rectangle
{
width: 70%;
height: 5%;
border: 1px solid black;
padding: 5%;
margin-top: 0%;
background-color: #FAFAFA;
opacity: 0.4;
display: block;
text-decoration: none;
text-align: center;
font-family: Comic Sans MS;
box-shadow: 10px 10px 5px #888888;
}
how will I make the design like the one in the image? Should I use canvas property.
demo - http://jsfiddle.net/victor_007/xhaLqvav/2/
use pseudo element :after and :before for styling right box and rounded
a {
font-size: 1.2em;
white-space: normal;
}
a.rectangle {
width: 70%;
height: 5%;
border: 2px solid black;
padding: 5%;
margin-top: 0%;
background-color: #FAFAFA;
opacity: 0.4;
display: block;
text-decoration: none;
text-align: center;
font-size: 32px;
font-family: Comic Sans MS;
box-shadow: 10px 10px 5px #888888;
position: relative;
}
a:before {
content: '';
border-right: 2px solid black;
height: 100%;
position: absolute;
background: orange;
width: 50px;
top: 0;
bottom: 0;
left: 0;
}
a:after {
content: '';
width: 30px;
height: 30px;
border-radius: 50%;
background: black;
position: absolute;
left: 35px;
top: 50%;
transform: translatey(-50%)
}
Stanford
<br>