I have created a modal view that I want to appear in the middle of the screen when a button #showModalView is pressed and gets hidden if a user clicks anywhere but inside the modal view. This is the code to the modal view: modal view fiddle.
I am having troubles integrating this view into the current website. This is the backbone of my website:
<div>
<div class="header">THIS IS HEADER</div>
<p>paragraph 1</p>
<p>paragraph 1</p>
<div class="button">
<a id="showModalView" href="#">CLICK ME</a>
</div>
<br />
<div class="FOOTER">THIS IS FOOTER</div>
</div>
Any idea how can I do this?
Assuming you can use jQuery you can do this...
$("#showModalView").click(function(){
$("#buy-wrapper").show();
});
$("#buy-wrapper").click(function(e){
if ($(e.target).closest("#buy-box").length === 0)
$("#buy-wrapper").hide();
});
.buy-input-general {
outline: none;
}
#buy-wrapper {
display:none;
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
background:rgba(200, 54, 54, 0.5);
}
#buy-box {
width: 345px;
height: 470px;
background-color: #fff;
margin: 0 auto;
-webkit-border-radius: 4px;
-o-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 3px;
border: thin solid #ededed;
}
#top_header {
width: 100%;
margin: 0;
padding-top: 45px;
}
#top_header > h3 {
text-align: center;
font-family: 'Lato', sans-serif;
font-size: 32px;
font-weight: 800;
color: #282828;
-webkit-text-stroke: 0.5px;
margin: 0;
}
#top_header > h5 {
text-align: center;
font-family: 'Roboto', sans-serif;
font-size: 15px;
font-weight: 300;
color: #424242;
line-height: 1.6;
margin: 0;
padding: 15px 0;
color: #a6a6a6;
-webkit-text-stroke: 0.2px;
}
#buy-inputs {
width: 100%;
height: 100%;
margin: 0 auto;
position: relative;
}
.buy-input-submit, .buy-input-text {
width: 300px;
height: 55px;
position: relative;
margin: 0 auto;
display: block;
margin-bottom: 10px;
padding: 15px;
box-sizing: border-box;
-webkit-text-stroke: 0.1px;
}
.buy-input-text {
font-family: 'Lato', sans-serif;
font-weight: 300;
border: thin solid #efefef;
color: #4f4f4f;
}
.buy-input-text:focus {
border: thin solid #ededed;
-webkit-transition: all .4s ease;
-moz-transition: all .4s ease;
-o-transition: all .4s ease;
transition: all .4s ease;
}
.buy-input-text:focus{
border-left: thin solid #282828;
}
.buy-input-submit {
color: #282828;
background-color: #fff;
border: 1px solid #282828;
border-radius: 2px;
font-family: 'Roboto', sans-serif;
font-weight: 400;
transition: all .2s ease;
margin-top: 15px;
cursor: pointer;
font-size:115%;
}
.buy-input-submit:hover {
background-color: #289928;
color: #fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<div class="header">THIS IS HEADER</div>
<p>paragraph 1</p>
<p>paragraph 1</p>
<div class="button">
<a id="showModalView" href="#">CLICK ME</a>
</div>
<br />
<div class="FOOTER">THIS IS FOOTER</div>
</div>
<div id="buy-wrapper">
<div id="buy-box">
<div id="top_header">
<h3>Lallaa</h3>
<h5>
Enter details. <br />
You know, because reasons and stuff. <br />Just do it.
</h5>
</div>
<di id="buy-inputs">
<input class="buy-input-text buy-input-general" type="text" placeholder="First name">
<input class="buy-input-text buy-input-general" type="text" placeholder="Last name">
<input class="buy-input-text buy-input-general" type="text" placeholder="Email">
<input class="buy-input-submit buy-input-general" type="submit" value="NEXT">
</di>
<div id="bottom">
</div>
</div>
</div>
Related
I'm trying fix the Log-In & registration form. When you click on "Register" on my menu, you can see that the labels are perfectly formatted in the form but the input box are offset. I tried to fix it with float:left but it didn't work out too well. If somebody could help me with that, that would be awesome.
var popup = document.getElementById('id01');
var popupreg = document.getElementById('id02');
window.onclick = function(event) {
if (event.target == popup) {
popup.style.display = "none";
}
if (event.target == popupreg) {
popupreg.style.display = "none";
}
}
body {
margin: 0 auto;
background: #fff;
}
div.container {
text-align: center;
box-sizing: border-box;
margin: 0 auto;
padding: 5px;
background-color: #000;
}
a.nounderline span {
color: #00B200;
}
.main-menu {
width: 200px;
margin: 0 auto;
right: 26px;
position: fixed;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
height: 35%;
}
.floating-sidebar li {
text-decoration: none;
outline: none;
line-height: 2em;
display: block;
border-radius: auto;
position: relative;
top: 10px;
-webkit-transition: none;
-o-transition: none;
transition: none;
}
.floating-sidebar li a {
background-color: #fff;
color: #444950;
display: block;
padding: 7px;
text-decoration: none;
font-family: Arial, sans-serif;
font-size: 18;
font-weight: bold;
border-radius: 9px;
}
.floating-sidebar li a:hover {
background-color: #eee;
color: #00B200;
}
.floating-sidebar li a.active {
background-color: #eee;
color: #00B200;
}
.floating-sidebar:hover li a.register-link {
color: #b5e7a0;
background: #fff;
}
.floating-sidebar li a.active:hover {
background-color: #00B200;
color: #fff;
}
.topnav input[type=text] {
float: left;
padding: 4.5px;
padding-left: 28px;
width: 305px;
border: 2px solid #00B200;
border-radius: 18px;
outline: inherit;
margin-top: 80px;
margin-left: 115px;
font-family: Arial, sans-serif;
font-weight: bold;
font-size: 18px;
direction: inherit;
}
input::placeholder {
color: #BEBEBE;
}
span.topnav {
right: 50px;
}
.sortby-box {
padding-top: 124px;
padding-left: 44;
margin: 0 auto;
position: fixed;
}
.select-opt {
padding: 4px;
width: 120px;
border-radius: 8px;
outline: none;
border: 1px solid #00B200;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.select-opt option {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.popup,
.popupreg {
display: none;
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.8);
/* Black w/ opacity */
padding-top: 60px;
}
.popup-content,
.popupreg-content {
float: left;
position: fixed;
background-color: rgb(245, 245, 245);
width: 600px;
height: 400px;
border-radius: 39px;
left: 666px;
top: 210px;
border: 2px solid rgb(109, 196, 109);
}
.popup,
.popupreg label {
font-family: Arial, Helvetica, sans-serif;
}
.popup [type=text],
[type=password] {
padding: 6px 8px;
width: 250px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
margin: 10px 0;
margin-left: 15px;
box-sizing: border-box;
}
.popupreg [type=text],
[type=password] {
padding: 6px 8px;
width: 250px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
margin: 10px 0;
margin-left: 15px;
box-sizing: border-box;
}
.popup input[type=submit] {
padding: 8px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
}
.popupreg input[type=submit] {
padding: 8px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
}
.popup [type=submit] {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
background-color: #fff;
color: #00B200;
font-size: 22px;
padding: 180px;
margin-left: 88px;
margin-top: 5px;
width: 250px;
height: 60px;
}
.popupreg [type=submit] {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
background-color: #fff;
color: #00B200;
font-size: 22px;
padding: 180px;
margin-left: 88px;
margin-top: 5px;
width: 250px;
height: 60px;
}
.popup .submit-log:hover {
color: #fff;
background-color: #00B200;
cursor: pointer;
}
.popupreg .submit-log:hover {
color: #fff;
background-color: #00B200;
cursor: pointer;
}
.cancel {
text-align: right;
position: relative;
cursor: pointer;
}
.close {
position: absolute;
right: 25px;
top: 0;
color: #000;
font-size: 35px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
.username-section,
.reg-section {
padding: 32px;
margin-left: 75px;
margin-top: 20px;
}
span.psswrd {
float: right;
padding-top: 16px;
}
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
<header>
<div class="container">
Hello
</div>
</header>
<main>
<aside>
</aside>
</main>
<sidebar>
<div class="main-menu">
<ul class="floating-sidebar">
<li>Log In</li>
<li>Register</li>
<li>About</li>
<li>Language</li>
</ul>
</div>
</sidebar>
<div class="sortby-box">
<select class="select-opt">
<option>Newest</option>
<option>Popularity</option>
<option>Recommended</option>
</select>
</div>
<div class="topnav">
<input style="position:relative;" type="text" name: "searchText" placeholder="Search here.." maxlength="18">
<span style="position:absolute; left: 126px; top: 119px;" class="fa fa-search icon"></span>
</div>
<div id="id01" class="popup">
<form class="popup-content" action="/action_page.php" method="get">
<div class="cancel">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="username-section">
<label for="usrname">Username</label>
<input type="text" id="usrname" name="usrname" minlength="6" maxlength="20"><br><br>
<label for="psswrd">Password</label>
<input type="password" id="passwrd" name="psswrd" minlength="6" maxlength="20"><br><br>
<input type="submit" class="submit-log" value="Log In">
</div>
</form>
</div>
<div id="id02" class="popupreg">
<form class="popupreg-content" action="/action_page.php" method="get">
<div class="cancel">
<span onclick="document.getElementById('id02').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="reg-section">
<label for="usrname">Username</label>
<input type="text" id="usrname" name="usrname" minlength="6" maxlength="20"><br><br>
<label for="usrname">Mail</label>
<input type="text" id="mail" name="mail" minlength="6" maxlength="20"><br><br>
<label for="psswrd">Password</label>
<input type="password" id="passwrd" name="psswrd" minlength="6" maxlength="20"><br><br>
<input type="submit" class="submit-log" value="Register">
</div>
</form>
</div>
<script src="index.js"></script>
<footer>
</footer>
A simple fix would be to give the label elements a display: inline-block; and give them a defined width such as width: 100px;.
I quickly created a JSFiddle to illustrate.
Hope this helped.
I am new to css so I cannot figure out the way of changing the color of pop up menus two buttons (Submit and Reset). Both of these are placed at the end of the pop up menu, but are not readable because of the color. I have used this code from this site and here the color of button is teal but in my code the button and text color is white and because of this I am unable to read the buttons.
I have tried changing the background color, text color in css but nothing is working
image
Current Image
Current image
I expect the button to be blue
```
.gbtn{
background: #d0d0d0;
color: #444444;
padding: 0 15px;
text-transform: uppercase;
height: 40px;
line-height: 40px;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
font-size: 12px;
}
.gbtn.btn-estimate{
padding:0 22px;
margin-top:7px;
}
.gbtn.btn-discount{
padding:0 26px;
}
.gbtn:hover{
background: #fbc443;
color: #25BCE9;
}
.gbtn:hover span{
color: #25BCE9;
}
.gbtn span{
display: inline-block;
}
button{
/* border:none;
background: #25BCE9;
color: #fff;
display: flex;
justify-content: flex-start;*/
}
#contactForm {
display: none;
z-index: 10000;
border: 3px solid #25BCE9;
padding: 2em;
width: 400px;
text-align: center;
background: #fff;
position: fixed;
top:50%;
left:50%;
transform: translate(-50%,-50%);
-webkit-transform: translate(-50%,-50%)
}
input{
height: 40px;
margin: .8em auto;
font-family: inherit;
text-transform: inherit;
font-size: inherit;
display: block;
width: 280px;
padding: .4em;
}
textarea {
height: 80px;
width:337px;
margin-right: 5px;
margin-bottom: 5px;
font-family: inherit;
text-transform: inherit;
font-size: inherit;
display: block;
padding: .4em;
resize: none;}
.formBtn {
display: inline-block;
background: teal;
color: #fff;
width: 140px;
font-weight: 100;
font-size: 1.2em;
padding: 5px 0;
border: none;
}
<div class="block-currency">
<div class="gbtn btn-estimate">
<div id="contact">Get Quote</div>
</div>
<div id="contactForm">
<h1>Keep in touch!</h1>
<small>We'll get back to you as quickly as possible</small>
<form action="#">
<input placeholder="Name" type="text" required />
<input placeholder="Email" type="email" required />
<input placeholder="Subject" type="text" required />
<textarea placeholder="Comment"></textarea>
<input class="formBtn" type="submit" />
<input class="formBtn" type="reset" />
</form>
</div>
</div>
Block Currency Code
.block-currency{
position:relative;
float:right;
cursor:pointer;
line-height:50px;
height:50px;
}
.block-currency:hover ul{
visibility:visible;
top:50px;
opacity:1;
transition: all 0.3s;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
}
```
.gbtn{
background: #d0d0d0;
color: #444444;
padding: 0 15px;
text-transform: uppercase;
height: 40px;
line-height: 40px;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
font-size: 12px;
}
.gbtn.btn-estimate{
padding:0 22px;
margin-top:7px;
}
.gbtn.btn-discount{
padding:0 26px;
}
.gbtn:hover{
background: #fbc443;
color: #25BCE9;
}
.gbtn:hover span{
color: #25BCE9;
}
.gbtn span{
display: inline-block;
}
button{
/* border:none;
background: #25BCE9;
color: #fff;
display: flex;
justify-content: flex-start;*/
}
#contactForm {
z-index: 10000;
border: 3px solid #25BCE9;
padding: 2em;
width: 400px;
text-align: center;
background: #fff;
position: relative;
top:0%;
left:0%;
}
input{
height: 40px;
margin: .8em auto;
font-family: inherit;
text-transform: inherit;
font-size: inherit;
display: block;
width: 280px;
padding: .4em;
}
textarea {
height: 80px;
width:337px;
margin-right: 5px;
margin-bottom: 5px;
font-family: inherit;
text-transform: inherit;
font-size: inherit;
display: block;
padding: .4em;
resize: none;}
.formBtn {
display: inline-block;
background: teal;
color: #fff;
width: 140px;
font-weight: 100;
font-size: 1.2em;
padding: 5px 0;
border: none;
}
<div class="block-currency">
<div class="gbtn btn-estimate">
<div id="contact">Get Quote</div>
</div>
<div id="contactForm">
<h1>Keep in touch!</h1>
<small>We'll get back to you as quickly as possible</small>
<form action="#">
<input placeholder="Name" type="text" required />
<input placeholder="Email" type="email" required />
<input placeholder="Subject" type="text" required />
<textarea placeholder="Comment"></textarea>
<input class="formBtn" type="submit" />
<input class="formBtn" type="reset" />
</form>
</div>
</div>
The quickest and easiest way is to add IDs to the input elements:
<input id="submitButton"class="formBtn" type="submit" />
<input id="resetButton"class="formBtn" type="reset" />
and change their color by targeting directly:
#submitButton {
background: blue;
}
#resetButton {
background: blue;
}
I am trying to keep the the form elements in one line and as to keep it exactly like this way for all type of resolutions i.e to keep it responsive in the same state but whenever I try to minimize the screen resolution so the form contents get messed up and the Search button goes to the second line as I do not want it to be like that..I simply want it to be in the same state i.e the Search button to stay along next to the input even when the window is minimized so how easily that would be achievable??? As I do know that it can be achieved with the use of CSS Media Queries..!
Here is the GIF :
LIVE PAGE LINK : http://huntedhunter.com/extratorrent/
Here is Code :
HTML :
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div style="padding: 7%;margin-top: 100px;">
<h1>E<span>XTRATORRENT</span> A<span>UTOMATIC</span> D<span>OWNLOADER</span></h1>
<form>
<input class="icon" name="search" placeholder="Search Torrent Name" type="text"> <input class="btn btn-secondary" name="search" type="submit" value="Search">
</form>
</div>
<footer class="footer">
<p>Copyrighted By <strong>Hunted Hunter Solutions</strong>.A Script By <strong>Umair Shah Yousafzai</strong></p>
</footer>
</body>
</html>
CSS :
input[type=text].icon {
width: 89%;
padding: 12px 20px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
font-size: 16px;
background-color: white;
background-image: url(searchicon.png);
background-position: 10px 13px;
background-repeat: no-repeat;
padding-left: 42px;
}
h1 {
font-family: Arial;
opacity: 0.6;
text-align: center;
}
span {
font-size: 70%;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
background-color: #eee2e2;
margin-left: -0.5%;
}
body {
overflow-x: hidden;
}
p {
text-align: center;
font-family: Arial;
opacity: 0.7;
}
a {
text-decoration: none;
}
.btn-secondary:hover {
color: #292b2c;
background-color: #e6e6e6;
border-color: #adadad;
cursor: pointer;
}
.btn:focus, .btn:hover {
text-decoration: none;
}
[type=reset], [type=submit], button, html [type=button] {
-webkit-appearance: button;
}
.btn-secondary {
color: #292b2c;
background-color: #fff;
border-color: #adadad;
}
.btn {
border: 1px solid turquoise;
padding: 1.2% 1.5rem;
font-size: 1rem;
border-radius: .25rem;
-webkit-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
You could use a flex-box for this.
Add the .flex class to your <form> tag, along with the rules:
.flex {
display:flex;
flex-wrap:nowrap;
justify-content:center;
}
replace width: 89%; with flex-grow:4; on the input[type=text].icon selector,
Finally add flex-grow:1; and margin-left:5px; to the .btn selector
input[type=text].icon {
flex-grow: 4;
padding: 12px 20px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
font-size: 16px;
background-color: white;
background-image: url(searchicon.png);
background-position: 10px 13px;
background-repeat: no-repeat;
padding-left: 42px;
}
h1 {
font-family: Arial;
opacity: 0.6;
text-align: center;
}
span {
font-size: 70%;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
background-color: #eee2e2;
margin-left: -0.5%;
}
body {
overflow-x: hidden;
}
p {
text-align: center;
font-family: Arial;
opacity: 0.7;
}
a {
text-decoration: none;
}
.btn-secondary:hover {
color: #292b2c;
background-color: #e6e6e6;
border-color: #adadad;
cursor: pointer;
}
.btn:focus,
.btn:hover {
text-decoration: none;
}
[type=reset],
[type=submit],
button,
html [type=button] {
-webkit-appearance: button;
}
.btn-secondary {
color: #292b2c;
background-color: #fff;
border-color: #adadad;
}
.btn {
flex-grow: 1;
margin-left: 5px;
border: 1px solid turquoise;
padding: 1.2% 1.5rem;
font-size: 1rem;
border-radius: .25rem;
-webkit-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.flex {
display: flex;
flex-wrap: nowrap;
justify-content: center;
}
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div style="padding: 7%;margin-top: 100px;">
<h1>E<span>XTRATORRENT</span> A<span>UTOMATIC</span> D<span>OWNLOADER</span></h1>
<form class="flex">
<input class="icon" name="search" placeholder="Search Torrent Name" type="text" /> <input class="btn btn-secondary" name="search" type="submit" value="Search" />
</form>
</div>
<footer class="footer">
<p>Provided without garanties by a <strong>Welldoer</strong>. A Script By <strong>Lars</strong></p>
</footer>
</body>
</html>
I have the following Code:
How can I edit my CSS in such a way so .pricing-customer background would change to one color:#333 and all of my paragraph styles would change to another color:#fff when I hover the .pricing-customer block. Because now I if I hover the block it change only the background and the paragraph style only changes when I hover the paragraph itself. And how can I make the color of .pricing-customer and all my paragraph would change on click? (To the same color as on hover)
.pricing-customer {
background: #fff;
min-height: 250px;
cursor: pointer;
transition: all .3s ease-in-out;
margin-bottom: 20px;
padding: 10px 0px 25px 0px;
}
p.pricing-number {
font-size: 52px;
margin-bottom: 10px;
margin-top: 20px;
color: #fead0d;
}
p.pricing-monthes {
color: #5e6977;
font-size: 14px;
line-height: 21px;
padding-bottom: 20px;
border-bottom: 1px solid #e1e8ee;
}
p.emails {
color: #444;
font-size: 16px;
line-height: 21px;
}
<div class="pricing-customer col-sm-12 col-sm-3 text-center">
<h3><?php echo $t_title; ?></h3>
<p class="pricing-number">$ 70</p>
<br>
<p class="pricing-monthes">per week/month</p>
<p class="pricing-emails">100 000 emails</p>
</div>
Thank you in advance
just use pseudo selector :hover
$('.pricing-customer').on('click', function(){
$(this).toggleClass('active');
$(this).children().toggleClass('active');
});
.pricing-customer {
background: #fff;
min-height: 250px;
cursor: pointer;
transition: all .3s ease-in-out;
margin-bottom: 20px;
padding: 10px 0px 25px 0px;
}
p.pricing-number {
font-size: 52px;
margin-bottom: 10px;
margin-top: 20px;
color: #fead0d;
}
p.pricing-monthes {
color: #5e6977;
font-size: 14px;
line-height: 21px;
padding-bottom: 20px;
border-bottom: 1px solid #e1e8ee;
}
p.emails {
color: #444;
font-size: 16px;
line-height: 21px;
}
.pricing-customer:hover, .pricing-customer.active {
background-color: #333;
}
.pricing-customer:hover p , .pricing-customer p.active{
color: #fff;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="pricing-customer col-sm-12 col-sm-3 text-center">
<h3><?php echo $t_title; ?></h3>
<p class="pricing-number">$ 70</p>
<br>
<p class="pricing-monthes">per week/month</p>
<p class="pricing-emails">100 000 emails</p>
</div>
To achieve this, you will need to add a small code snippet which will toggle active class on pricing-customer div element.
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<style type="text/css">
.pricing-customer {
background: #fff;
min-height: 250px;
cursor: pointer;
transition: all .3s ease-in-out;
margin-bottom: 20px;
padding: 10px 0px 25px 0px;
}
p.pricing-number {
font-size: 52px;
margin-bottom: 10px;
margin-top: 20px;
color: #fead0d;
}
p.pricing-monthes {
color: #5e6977;
font-size: 14px;
line-height: 21px;
padding-bottom: 20px;
border-bottom: 1px solid #e1e8ee;
}
p.emails {
color: #444;
font-size: 16px;
line-height: 21px;
}
.pricing-customer:hover {
background-color: #333;
}
.pricing-customer:hover p {
color: #fff;
}
.pricing-customer.active,
.pricing-customer.active p {
background-color: #333;
color: #fff;
}
</style>
</head>
<body>
<div class="pricing-customer col-sm-12 col-sm-3 text-center">
<h3><?php echo $t_title; ?></h3>
<p class="pricing-number">$ 70</p>
<br>
<p class="pricing-monthes">per week/month</p>
<p class="pricing-emails">100 000 emails</p>
</div>
<script>
$('.pricing-customer').on('click', function(){
$(this).toggleClass('active');
});
</script>
</body>
</html>
.pricing-customer {
background: #fff;
min-height: 250px;
cursor: pointer;
transition: all .3s ease-in-out;
margin-bottom: 20px;
padding: 10px 0px 25px 0px;
}
.pricing-customer:hover{
background: #333;
}
p.pricing-number:hover,p.pricing-monthes:hover,p.pricing-emails:hover{
color: #fff;
}
p.pricing-number {
font-size: 52px;
margin-bottom: 10px;
margin-top: 20px;
color: #fead0d;
}
p.pricing-monthes {
color: #5e6977;
font-size: 14px;
line-height: 21px;
padding-bottom: 20px;
border-bottom: 1px solid #e1e8ee;
}
p.emails {
color: #444;
font-size: 16px;
line-height: 21px;
}
<div class="pricing-customer col-sm-12 col-sm-3 text-center">
<h3><?php echo $t_title; ?></h3>
<p class="pricing-number">$ 70</p>
<br>
<p class="pricing-monthes">per week/month</p>
<p class="pricing-emails">100 000 emails</p>
</div>
Try it:
html:active {
background: yellow;
}
<h2>click anywhere</h2>
Everything is good except when the screen is resized the button goes off the screen. I have tried to fix this but I haven't been able to figure out how to resolve this. I have attached screen shots as well to get a better idea of what I'm talking about. Using HTML5 CSS3 and bootstrap
<section id="prod-one" class="prod-one">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="col-md-6 col-sm-6">
<div class="block wow fadeInRight" data-wow-delay=".3s" data-wow-duration="500ms">
<img src="images/cusotm%20image.jpg" alt="Custom">
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="block wow fadeInLeft" data-wow-delay=".3s" data-wow-duration="500ms">
<h3>test</h3>
<h2>test</h2>
<p class="par-one-ma">test</p>
<p>
test
</p>
<div class="area-fir"><a class="btn-max" href="#">Discover</a> </div>
</div>
</div>
</div>
</div>
</div>
</section>
CSS
#prod-one {
padding-top: 140px;
padding-bottom:;
}
#prod-oned .block {
padding: 20px 30px 30px;
}
#prod-one .block h2 {
font-size: 25px;
font-weight: 500;
margin-bottom: 30px;
text-transform: none;
color: #00bfff;
}
#prod-one.block h3 {
font-size: 40px;
font-weight: 400;
margin-bottom: 30px;
text-transform: uppercase;
}
#prod-one.block p {
color: #727272;
font-size: 16px;
line-height: 28px;
margin-bottom: 35px;
}
#prod-one .block img {
max-width: 100%;
padding-top: 25px;
}
#prod-one .block .matrix-bold {
font-weight: 500;
margin-top: -20px;
}
.btn-max {
width: auto;
margin-right: auto;
padding: 2% 50%;
font-weight: 500;
text-decoration: none;
background-color: #fff;
color: #00bfff;
transition: background-color 0.2s, border 0.2s, color 0.2s;
border: 2px solid #00bfff;
letter-spacing: .5px;
font-size: 18px;
}
.btn-max:hover,
.btn-max:active {
border: 2px solid #00bfff;
background-color: #00bfff;
color: #1c1c1c;
}
#prod-one {
padding-top: 140px;
padding-bottom:;
}
#prod-oned .block {
padding: 20px 30px 30px;
}
#prod-one .block h2 {
font-size: 25px;
font-weight: 500;
margin-bottom: 30px;
text-transform: none;
color: #00bfff;
}
#prod-one.block h3 {
font-size: 40px;
font-weight: 400;
margin-bottom: 30px;
text-transform: uppercase;
}
#prod-one.block p {
color: #727272;
font-size: 16px;
line-height: 28px;
margin-bottom: 35px;
}
#prod-one .block img {
max-width: 100%;
padding-top: 25px;
}
#prod-one .block .matrix-bold {
font-weight: 500;
margin-top: -20px;
}
.btn-max {
width: auto;
margin-right: auto;
padding: 2% 44%;
font-weight: 500;
text-decoration: none;
background-color: #fff;
color: #00bfff;
transition: background-color 0.2s, border 0.2s, color 0.2s;
border: 2px solid #00bfff;
letter-spacing: .5px;
font-size: 18px;
}
.btn-max:hover,
.btn-max:active {
border: 2px solid #00bfff;
background-color: #00bfff;
color: #1c1c1c;
}
<section id="prod-one" class="prod-one">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="col-md-6 col-sm-6">
<div class="block wow fadeInRight" data-wow-delay=".3s" data-wow-duration="500ms">
<img src="images/cusotm%20image.jpg" alt="Custom">
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="block wow fadeInLeft" data-wow-delay=".3s" data-wow-duration="500ms">
<h3>test</h3>
<h2>test</h2>
<p class="par-one-ma">test</p>
<p>
test
</p>
<div class="area-fir"><a class="btn-max" href="#">Discover</a> </div>
</div>
</div>
</div>
</div>
</div>
</section>
Update your css [padding: 2% 45%;] as follows works perfectly:-
.btn-max {
font-weight: 500;
text-decoration: none;
background-color: #FFF;
color: #00BFFF;
transition: background-color 0.2s ease 0s, border 0.2s ease 0s, color 0.2s ease 0s;
border: 2px solid #00BFFF;
letter-spacing: 0.5px;
font-size: 18px;
width: 21%;
padding: 2% 45%;
}