when resizing the screen the button goes off the page - html

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%;
}

Related

HTML - First Text in div will not be pushed down

I have an h1 tag in a div, and I would like for it to be pushed down from right up to the top of the div. I have tried adding a top margin on the h1 but that doesn't help. When I put some text in the div '#contact', Suddenly the h1 moves down. Is there a way to move the h1 down without text in '#contact'? Thank you in advance.
Snippet:
<div style="float:left; margin: 0; width: 100%;background-color:#eeeeee;font-size: 20px;color: #252a30;text-align: center;">
<style>
.half {
width: 40%;
margin: 3%;
font-size: 0.7em;
display: block;
}
.hl {
text-align: left;
float: left;
}
.hr {
text-align: right;
float: right;
}
.project-tags {
color: #b2c6cd;
font-size: 0.9rem;
font-weight: 700;
letter-spacing: 1px;
opacity: 1;
text-transform: uppercase;
}
.half ul, .half h1 {
margin-bottom: 0px;
margin-top: 0px;
}
.half h1 {
margin-bottom: 5px;
}
.project-tags li {
color: #fed766;
}
.project-tags span {
color: #b2c6cd;
}
.half p {
font-weight: 300;
font-size: 20px;
}
.button-primary {
margin: 10px 0 60px;
color: #252a30;
background-color: rgba(0, 0, 0, 0);
border: 2px solid #FED766;
height: auto;
font-size: 1rem;
line-height: normal;
text-transform: uppercase;
font-weight: 700;
transition: all .3s ease-in-out;
letter-spacing: 0;
border-radius: 50px;
display: inline-block;
text-align: center;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
box-sizing: border-box;
outline: 0;
padding: 1.0rem 3.0rem;
}
.button-primary:hover {
color: #FED766;
background-color: #252a30;
border: 2px solid #252a30;
padding: 1.0rem 3.5rem;
}
.on-ylw {
border: 2px solid #252a30;
}
</style>
<p id="projects"></p>
<h1>My Projects</h1>
<p style="font-weight: 300;">Examples of my work</p>
<div class="projects" style="margin: 0 15%;">
<div class="half hl">
<h1>Text</h1>
<ul class="project-tags">
<li><span>Python</span></li>
</ul>
<p>Text</p>
Visit Website
</div>
<div class="half hr">
<img src="image" alt="link" style="border-radius: 10px;position: relative: width: 100%; border-style: none;">
</div>
</div>
</div>
<div style="margin: 0; width: 100%; background-color: #FED766;position: static;">
<div id="contact"></div>
<br>
<br>
<h1 style="text-align: center; font-weight: bold; color: #000000; font-size: 40px;">Want To Contact Me</h1>
<p style="text-align: center; font-weight: 300; font-size: 25px; color: #000000;">I'm currently accepting new projects and would love to hear about yours.</p>
<br>
<button class="button-primary on-ylw" style="display: table; margin: 0 auto;">Contact Me</button>
<br>
<br>
</div>
Add:
clear: both;
property to the <div> that the h1 is in.
The div up the DOM you have float: left; therefore it's not actually in the dom where you'd expect.
Then you should be able to add marign-top to the H1 as expected.

Change the blocks color on hover and on click (and stay active)

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>

integrating modal view into the website that shows on button click

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>

When I hover a element, another element which both have display: inline-block, goes down?

I'm having a some kind of serious issue about a staffs page i'm working on. I make a button which contains the staff's username when user hovers that element there's a social button has to be display: block. There's no problem with that. It becomes visible but when I hover the other element goes more or less 10px's down.
jsbin: https://output.jsbin.com/tozemihefu/
I will appreciate your help.
CODE SNIPPET:
.yetkili {
display: inline-block;
padding: 10px 25px;
}
.yetkili img {
border-radius: 100%;
padding-bottom: 10px;
}
.yetkili div ul {
display: none;
list-style: none;
}
.yetkili div ul li {
font-size: 10px;
color: white;
}
.yetkili div {
transition: all 0.3s ease;
border: 3px solid #bbcada;
padding: 5px 10px;
border-top-left-radius: 10px;
border-bottom-right-radius: 10px;
font-size: 16px;
color: #5C7A99;
font-family: 'Montserrat', sans-serif;
display: block;
text-decoration: none;
}
.yetkili div:hover ul {
display: block;
}
.yetkili div:hover {
transition: all 0.3s ease;
border: 3px solid #bbcada;
background-color: #bbcada;
padding: 5px 10px;
border-top-left-radius: 10px;
border-bottom-right-radius: 10px;
font-size: 16px;
color: white;
font-family: 'Montserrat', sans-serif;
display: block;
text-decoration: none;
}
h1 {
font-family: 'Montserrat', sans-serif;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid" style="margin-top: 1%;">
<div class="row text-center">
<div class="col-sm-12 text-center">
<h1 class="anaheader">Kurucular</h1>
</div>
<div class="col-md-offset-3 col-md-6">
<div class="yetkili">
<img src="https://minotar.net/helm/AtomTR/128.png">
<div>AtomTR
<ul>
<li>asd</li>
</ul>
</div>
</div>
<div class="yetkili">
<img src="https://minotar.net/helm/RepublicanSensei/128.png">
<div>RepublicanSensei
<ul>
<li>asd</li>
</ul>
</div>
</div>
</div>
</div>
</div>
You can add vertical-align: top to the container:
.yetkili{
display: inline-block;
padding: 10px 25px;
vertical-align: top;
}
DEMO

Icon divs not showing up on the same line

I have 4 icons on the landing page I'm building, each in their own div. For some reason, rather than keeping all 4 on the same line and resizing automatically, it keeps 3 on one line, and the 4th is always on a 2nd line, as you can see in the image below. What could be causing this to happen to just that one icon?
Here's the HTML:
<section id="services">
<div class="container">
<div class="row" id="services-positioning">
<div class="col-md-4 service-content sc1">
<span><i class="fa fa-hdd-o"></i></span>
<h4>Get Inspired</h4>
</div>
<div class="col-md-4 service-content sc2">
<span><i class="fa fa-diamond"></i></span>
<h4>Get Rewarded</h4>
</div>
<div class="col-md-4 service-content sc3">
<span><i class="fa fa-envelope-o"></i></span>
<h4>Be Creative</h4>
</div>
<div class="col-md-4 service-content sc4">
<span><i class="fa fa-envelope-o"></i></span>
<h4>Stay Connected</h4>
</div>
</div>
</div>
</section>
Relevant CSS:
#services {
padding: 100px 0;
}
.container {
width: 100%;
max-width: 400px;
}
#services2 .col-md-4 {
margin-bottom: 50px;
}
.service-content {
cursor: pointer;
}
/*
#services-positioning{
display: inline-block;
}
*/
.service-content span {
display: table;
margin: 0px auto 25px;
color: #3498db;
text-align: center;
transition: 0.3s;
-webkit-transition: 0.3s;
position: relative;
border: 2px solid #3498db;
width: 100px;
height: 100px;
display: table;
font-size: 35px;
border-radius: 50%;
padding-top: 22px;
}
.service-content:hover span {
background: #3498db;
color: #fff;
transition: 0.3s;
-webkit-transition: 0.3s;
}
.service-content:hover i {
transition: 0.3s;
-webkit-transition: 0.3s;
}
.service-content h4 {
font-size: 17px;
text-align: center;
font-weight: 700;
margin: 0px 0px 10px;
text-transform: none;
letter-spacing: 0.5px;
text-transform: uppercase;
}
.service-content p {
font-size: 14px;
text-align: center;
line-height: 22px;
margin: 0 0 10px;
color: #777;
font-weight: 300;
padding: 0 20px;
}
.service-content a {
color: #3498DB;
font-size: 14px;
text-align: center;
display: table;
margin: 0 auto;
}
.service-content a i {
font-size: 14px;
margin-left: 5px;
}
.service-content a:hover {
color: #000;
}
Change from col-md-4 to col-md-3. In Bootstrap, "col-md-4" means that, on a "medium"-width viewport (or larger), the element will span across 4 columns out of a total of 12 (twelve is just the arbitrary number of columns that exist in Bootstrap). Thus, only 3 items with that class name can fit in a line.
Here's a nice visual explanation of Bootstrap's grid system from their official docs.