I created a footer and used fontawesome icons with border.
On the following code I display the items and intend to have them as the picture shows
I was nearly there until I found that when I resize the screen, the icons also shrink like the photo show
Here my styling:
$footer: #464646;
.footer-font-awesome{
font-family: 'FontAwesome';
display: inline-block;
width: 40px;
height: 40px;
border: 1px solid white;
border-radius: 50%;
line-height: 40px;
text-align: center;
font-size: 18px;
text-indent: 0;
}
footer#colophon{
background-color: $footer;
color: white;
padding: 20px 40px;
ul,li,p{
margin: 0;
}
.site-info{
.textwidget {
display: flex;
justify-content: center;
div.box{
display: flex;
width: 100%;
max-width: 25%;
align-items: center;
p{
padding-left:8px;
}
}
.email,
.phone,
.address{
padding-right: 40px;
}
.email{
&:before{
#extend .footer-font-awesome;
content: '\f003';
}
}
.phone{
&:before{
#extend .footer-font-awesome;
content: '\f095';
}
}
.back-top{
justify-content: center;
}
.address{
&:before{
#extend .footer-font-awesome;
content: '\f041';
}
}
}
}
}
Here my html structure:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="site-info">
<section id="black-studio-tinymce-33" class="widget widget_black_studio_tinymce">
<div class="textwidget">
<div class="box email">
<p>Email<br> <span class="unbold"><a>info#web2web.co.za</a></span></p>
</div>
<div class="box phone">
<p>Phone<br> <span class="unbold">021 823 8384</span></p>
</div>
<div class="box address">
<p>Address<br> <span class="unbold">Century City, Cape Town</span></p>
</div>
<div class="box back-top">
<p><span class="unbold"><a class="back-top">To the top</a></span></p>
</div>
</div>
</section>
</div><!-- .site-info -->
</footer>
How can I style my icons as the first pictures shows with no problem even when I resize?
Hope you can edit from my snippet
I would just set min-width on .footer-font-awesome
.footer-font-awesome{
font-family: 'FontAwesome';
display: inline-block;
width: 40px;
min-width: 40px; // This...
height: 40px;
border: 1px solid white;
border-radius: 50%;
line-height: 40px;
text-align: center;
font-size: 18px;
text-indent: 0;
}
Related
this is my first time posting I'm fairly new in front-end web development. I'm having a hard time positioning some of my elements, especially this one every time I change something it doesn't meet my desired position for my button I just need to center it.
body {
margin: 0;
}
.container {
display: flex;
justify-content: space-around;
background: #1B244A;
width: 575px;
height: 385px;
}
h3 {
text-align: center;
color: white;
font-size: 40px;
position: relative;
top: 25px;
}
.scoreBox {
background: black;
width: 155px;
height: 120px;
border-radius: 5px;
text-align: center;
}
.scoreBox h1 {
font-size: 90px;
color: red;
padding: 10px 0;
font-family: 'cursed timer', sans-serif;
}
.scoreBtn {
display: flex;
justify-content: space-around;
padding: 10px 0;
}
.scoreBtn button {
background-color: transparent;
width: 45px;
height: 45px;
border-color: #9AABD8;
border-radius: 5px;
color: white;
}
.newGame {}
.newGame button {}
<html>
<head>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="container">
<div class="homeTitle">
<h3>HOME</h3>
<div class="scoreBox">
<h1 id="scoreHome">0</h1>
</div>
<div class="scoreBtn">
<button onclick="plusOneHome()">+1</button>
<button onclick="plusTwoHome()">+2</button>
<button onclick="plusThreeHome()">+3</button>
</div>
</div>
<div class="guestTitle">
<h3>GUEST</h3>
<div class="scoreBox">
<h1 id="scoreAway">0</h1>
</div>
<div class="scoreBtn">
<button onclick="plusOneAway()">+1</button>
<button onclick="plusTwoAway()">+2</button>
<button onclick="plusThreeAway()">+3</button>
</div>
</div>
<div class="newGame">
<button>New Game</button>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
I'm trying to figure out how to center the new game button that I put in a div class called newGame it always stays in the right corner.
Try this and see if it works for you, and you can always change the values to match the position of button according to your need.
.newGame{
position: absolute;
left: 15%;
top: 40%;
-webkit-transform: translate(-50%, -50%);
}
I guess this is what you are expecting
Use flex property align-items: center; to center any div element vertically when flex-direction in horizontal
body {
margin: 0;
}
.container {
display: flex;
justify-content: space-around;
background: #1b244a;
width: 575px;
height: 385px;
}
h3 {
text-align: center;
color: white;
font-size: 40px;
position: relative;
top: 25px;
}
.scoreBox {
background: black;
width: 155px;
height: 120px;
border-radius: 5px;
text-align: center;
}
.scoreBox h1 {
font-size: 90px;
color: red;
padding: 10px 0;
font-family: "cursed timer", sans-serif;
}
.scoreBtn {
display: flex;
justify-content: space-around;
padding: 10px 0;
}
.scoreBtn button {
background-color: transparent;
width: 45px;
height: 45px;
border-color: #9aabd8;
border-radius: 5px;
color: white;
}
.newGame {
display: flex;
align-items: center;
}
.newGame button {
}
<html>
<head>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<div class="container">
<div class="homeTitle">
<h3>HOME</h3>
<div class="scoreBox">
<h1 id="scoreHome">0</h1>
</div>
<div class="scoreBtn">
<button onclick="plusOneHome()">+1</button>
<button onclick="plusTwoHome()">+2</button>
<button onclick="plusThreeHome()">+3</button>
</div>
</div>
<div class="guestTitle">
<h3>GUEST</h3>
<div class="scoreBox">
<h1 id="scoreAway">0</h1>
</div>
<div class="scoreBtn">
<button onclick="plusOneAway()">+1</button>
<button onclick="plusTwoAway()">+2</button>
<button onclick="plusThreeAway()">+3</button>
</div>
</div>
<div class="newGame">
<button>New Game</button>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
I have made an about page for my class assignment. Everything worked fine until I used the inspect option to see if my webpage is responsive to other devices. It was not responsive, I tried to see what is wrong with the code but I could not find an error in my codes after 5 hrs. Help would be appreciated.
*{
margin: 0;
padding:0;
box-sizing: border-box;
color: white;
background-color: black;
}
.title12{
text-align: center;
font-size: 24px;
margin-top: 100px;
}
.p1{
text-align: center;
font-size: 20px;
margin-top: 200px;
}
h1{
text-align: center;
}
.h2{
margin-top: 400px;
}
.reviews{
margin-top: 400px;
margin-left: 300px;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
/* Float four columns side by side */
.column {
float: left;
width: 25%;
padding: 0 10px;
}
/* Remove extra left and right margins, due to padding */
.row {margin: 0 -5px;}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Responsive columns */
#media screen and (max-width: 600px) {
.column {
width: 100%;
display: block;
margin-bottom: 20px;
}
}
/* Style the counter cards */
.card {
padding: 16px;
text-align: center;
background-color: black;
}
.re1{
width: 250px;
}
.re3{
width:250px;
height: 350px;
}
.container2{
display: flex;
flex-direction: column;
justify-content: center;
align-items:justify;
text-align: center;
margin: 40px 20px 0 20px;
margin-top: 80px;
}
.container2 .heading{
width: 50%;
padding-bottom: 50px;
}
.container2 .heading h3{
font-size: 3em;
font-weight: bolder;
padding-bottom: 10px;
border-bottom: 3px solid white;
}
.container2 .heading h3 span{
font-weight: 100;
color: #fff;
}
.con2{
margin-top: auto;
margin-top: 900px;
}
.container{
max-width: 1280px;
margin: 2 auto;
display:flex;
align-items: center;
justify-content: space-between;
}
nav{
position:fixed;
top:0;
left:0;
right:0;
z-index: 99;
background-color: black;
padding: 16px 32px;
border-bottom: 3px solid blue ;
}
.menu{
display:flex;
justify-content: flex-end;
margin: 0 -16px;
flex: 1 1 0%;
}
.menu a{
color: white;
margin: 0 16px;
font-weight: 600;
text-decoration: none;
transition: 0.4s;
padding:8px 16px;
border-radius: 90px;
}
.menu a.highlight, .menu a:hover{
background-color:red;
}
a{
font-size: 25px;
text-decoration: none;
}
body {
margin: 0px;
font-weight: 400;
}
video {
width: 50%;
float: left;
margin-bottom: 35px;
}
.normal{
width: 100%;
}
.footer{
padding: 40px 0;
background-color: black;
}
.footer .social{
text-align: center;
padding-bottom: 25px;
color: white;
}
.footer .social a{
font-size: 24px;
color: white;
border: 1px solid white;
width: 40px;
height: 40px;
line-height: 38px;
display: inline-block;
text-align: center;
border-radius: 50%;
margin: 0 8px;
opacity: 0.75;
}
.footer .social a:hover{
opacity: 0.9;
}
.footer ul{
margin-top: 0;
padding: 0;
list-style: none;
font-size: 18px;
line-height: 1.6;
margin-bottom: 0;
text-align: center;
}
.footer ul li a{
color: white;
text-decoration: none;
opacity: 0.8;
}
.footer ul li{
display: inline-block;
padding: 0 15px;
}
.footer ul li a:hover{
opacity: 1;
color: red;
}
.footer .copy{
margin-top: 15px;
text-align: center;
font-size: 13px;
color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="about.css">
<script src="https://kit.fontawesome.com/57160f5774.js" crossorigin="anonymous"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="about.css">
<title>About Us</title>
</head>
<body>
<nav>
<div class="container">
<div class="menu">
Home
Products
PC Designs
Support
Build Your PC
</div>
</div>
</nav>
<img style="float: left; height: 750px;" src ="About us/V388-SUPRIM.png">
<div class="title12">
<h1>SUPRIMX</h1>
</div>
<div class="p1">
<p>SUPRIMX is a world leader in gaming, content creation, business & productivity and AIoT solutions. </p>
<p>Bolstered by its cutting-edge R&D capabilities and customer-driven innovation, SUPRIMX has a wide-ranging global presence spanning over 120 countries. Its comprehensive lineup of laptops, graphics cards, monitors, motherboards, desktops, peripherals, and telematics systems are globally acclaimed.</p>
</div>
<div class="reviews">
<div class="container2">
<div class="heading">
<h3>Reviews<span> </span></h3>
</div>
</div>
<div class="row">
<div class="column">
<div class="card">
<h3><img class="re1" src="About us/kayla.jpg"></h3>
<br>
<p>Kayla </p>
<br>
<p>
Amazing website to buy a lot of products!.
</p>
</div>
</div>
<div class="column">
<div class="card">
<br>
<br>
<h3><img class="re2" src="About us/Curtis.jpg"></h3>
<br>
<p>Curtis</p>
<br>
<p>5 stars!!</p>
</div>
</div>
<div class="column">
<div class="card">
<h3><img class="re3" src="About us/Tyler.jpg"></h3>
<br>
<p>Tyler</p>
<br>
<p>Incredible website!</p>
</div>
</div>
</div>
</div>
</div>
<hr>
<section class="footer">
<div class="social">
<i class="fa fa-facebook" aria-hidden="true"></i>
<i class="fa fa-twitter" aria-hidden="true"></i>
<i class="fa fa-youtube" aria-hidden="true"></i>
<i class="fa fa-pinterest" aria-hidden="true"></i>
</div>
<ul class="list">
<li>
Home
</li>
<li>
About SUPRIMX
</li>
<li>
Forums
</li>
<li>
Products
</li>
<li>
Support
</li>
</ul>
<p class="copy">
SUPRIMX © 2022
</p>
</section>
</body>
</html>
I am trying to build a page and I want the last div to be at the bottom but the one on top of it (second to the last) to have a vertical scrollbar on resize or when the elements don't fit. Here is a link to my jsfiddle (https://jsfiddle.net/tgz98s6w/) where you can see that the second to the last div overlaps with the last one sometimes and I want to avoid that.
I tried setting:
#windowsStoreBox {
position: absolute;
bottom: 0;
}
But it does not seem to work.
Thank you
/*
CSS File for Sharebox
*/
html,body {
margin: 0;
padding: 0;
background-color: #000000;
color: #FFFFFF;
overflow: hidden;
width:auto;
font: 15px "Segoe UI", "Tahoma";
border: 0.05em solid #535353;
cursor: default;
-webkit-user-select: none;
}
/* SCROLLBAR */
::-webkit-scrollbar {
width: 10px;
background-color: #747474;
opacity: 0.93;
}
::-webkit-scrollbar-track {
background: #171717;
}
::-webkit-scrollbar-thumb {
background: #454545;
}
::-webkit-scrollbar-thumb:hover {
background: #747474;
}
::-webkit-scrollbar-button:start {
height: 10px;
width: 10px;
background-color: #171717;
background-image: url('../buttons/angle_up.svg');
background-repeat: no-repeat;
background-size: 10px 6px;
background-position: center center;
border: none;
}
::-webkit-scrollbar-button:start:active {
background-color: #A2A2A2;
background-image: url('../buttons/angle_up_active.svg');
}
::-webkit-scrollbar-button:end {
height: 10px;
width: 10px;
background-color: #171717;
background-image: url('../buttons/angle_down.svg');
background-repeat: no-repeat;
background-size: 10px 6px;
background-position: center center;
border: none;
display: block;
}
::-webkit-scrollbar-button:end:active {
background-color: #A2A2A2;
background-image: url('../buttons/angle_down_active.svg');
}
/* END SCROLLBAR */
/* TITLEBAR */
.titlebar {
display: block;
position: relative;
height: 32px;
width: 100%;
overflow: hidden;
padding: 0;
-webkit-user-select: none;
cursor: context-menu;
background-color: #000000;
color: #CCCCCC;
}
.titlebar.titlebarLight {
background-color: #E6E6E6;
color: #2A2A2A;
}
.titlebarDarkBlur {
background-color: #3B3B3F;
}
.titlebarLightBlur {
background-color: #CCCCCC;
}
.titlebar.draggable {
-webkit-app-region: drag;
}
.titlebar-title {
float: left;
text-align: left;
font-size: 12px;
font-weight: light;
margin-left:36px;
margin-top:8px;
-webkit-user-select: none;
width: 70%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.titlebarTitleDarkBlur {
color: #CCCCCC;
}
.titlebarTitleLightBlur {
color: #838487;
}
.titlebar-controls {
float: right;
text-align: left;
}
.titlebar:after,
.titlebar-controls:after {
content: ' ';
display: table;
clear: both;
}
.titlebar-minimize,
.titlebar-resize,
.titlebar-close {
float: left;
width: 45px;
height: 31px;
margin: 1px 1px 0 0;
text-align: center;
line-height: 29px;
-webkit-transition: background-color .2s;
}
span.titlebar-icon {
font-family: "Segoe MDL2 Assets";
font-size: 10px;
color: #FFF;
}
span.titlebar-icon-light {
color: #000;
}
.titlebar.draggable .titlebar-close {
-webkit-app-region: no-drag;
}
.titlebar-close:hover {
background-color: rgba(232, 17, 35, 0.9);
}
/* END TITLEBAR */
/* SHAREBOX */
#shareBox {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-bottom: 1em;
padding-top: 0em;
height: 60px;
max-height: 60px;
overflow: none;
}
#shareBox div {
padding-bottom: 0.3em;
}
#shareBoxText {
font-size: 1.05em;
/* font-weight normal is 400, and bold is 700, so we want something in between */
font-weight: 600;
}
#shareBoxFileName {
font-size: 0.87em;
}
#shareBoxSubText {
color: #A2A2A2;
font-size: 0.87em;
}
div.shareBoxSeparator {
padding-top: 0.25em;
padding-bottom: 0;
margin-bottom: 0;
}
.shareBoxSeparator.padded {
padding-left: 15px;
padding-right: 15px;
}
div.shareBoxSeparator hr {
height: 1px;
background-color: #A2A2A2;
border: none;
padding-bottom: 0;
margin-bottom: 0;
}
/* END SHAREBOX */
/* SERVICES BOX */
#servicesBox {
/* Add scrolling. The window will be of a fixed height */
position: fixed;
padding-top: 0.3em;
padding-bottom: 0;
overflow-y: auto;
overflow-x: none;
height: calc(100% - (32px + 60px + 33px));
max-height: calc(100% - (32px + 60px + 33px));
}
#servicesBoxSocial {
display: inline-flex;
flex-wrap: wrap;
justify-content: center;
/*flex-direction: row;*/
}
.shareService {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 66px;
height: 84px;
}
.shareServiceLogoBox {
background-color: #6A68D6;
width: 40px;
height: 40px;
margin-bottom: 0.25em;
/* Align logos to the center */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.shareServiceLogoImage {
width: 20px;
height: 20px;
}
.shareServiceDescription {
font-size: 0.825em;
}
.shareService:hover {
background-color: #2E2E2E;
}
/* END SERVICES BOX */
/* WINDOWS STORE BOX */
#windowsStoreBox {
position: absolute;
bottom: 0;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 0.25em 0;
font-size: 0.81em;
border-bottom: 0.05em solid #535353;
height: 32px;
max-height: 32px;
overflow: none;
}
#windowsStoreBox:hover {
color: #A2A2A2;
}
#windowsStoreBox:hover g {
fill: #A2A2A2;
}
svg.windowsStoreLogo {
padding: 0 3px;
vertical-align: middle;
position: relative;
top: -2px;
}
/* END WINDOWS STORE BOX */
<!DOCTYPE html>
<html>
<head>
<title>Share</title>
<link rel="stylesheet" href="static/css/sharebox.css">
</head>
<body >
<!-- TITLEBAR -->
<div id="titlebar" class="titlebar draggable">
<div id='titlebar-title' class="titlebar-title"></div>
<div id='titlebar-controls' class="titlebar-controls">
<div id='titlebar-close' class="titlebar-close" title='Close'>
<span class='titlebar-icon'>ξΆ»</span>
</div>
</div>
</div>
<!-- END TITLEBAR -->
<!-- DESCRIPTION BOX -->
<div id='shareBox'>
<div id='shareBoxText'>Share</div>
<div id='shareBoxFileName' data-attr-filelocation='static/img/blank.svg'>tutankhamun.jpg</div>
<div id='shareBoxSubText'>This item will be shared.</div>
</div>
<!-- END DESCRIPTION BOX -->
<!--<div class='shareBoxSeparator padded'><hr /></div>-->
<!-- SERVICES BOX -->
<!-- This box allows you to share on facebook, twitter e.t.c -->
<div id='servicesBox'>
<!-- Add links to social media services and mail, onenote e.t.c -->
<div id='servicesBoxSocial'>
<!-- All services here -->
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/CopyFileLogo.svg' /></div>
<div class='shareServiceDescription'>Copy file</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/CopyLinkLogo.svg' /></div>
<div class='shareServiceDescription'>Copy link</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/MailLogo.svg' /></div>
<div class='shareServiceDescription'>Instagram</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/MailLogo.svg' /></div>
<div class='shareServiceDescription'>Mail</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/MailLogo.svg' /></div>
<div class='shareServiceDescription'>Feedback</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/OneNoteLogo.svg' /></div>
<div class='shareServiceDescription'>OneNote</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/MailLogo.svg' /></div>
<div class='shareServiceDescription'>Snip & Sketch</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/SkypeLogo.svg' /></div>
<div class='shareServiceDescription'>Skype</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/FacebookLogo.svg' /></div>
<div class='shareServiceDescription'>Facebook</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/TwitterLogo.svg' /></div>
<div class='shareServiceDescription'>Twitter</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/RedditLogo.svg' /></div>
<div class='shareServiceDescription'>Reddit</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/PinterestLogo.svg' /></div>
<div class='shareServiceDescription'>Pinterest</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/FacebookMessengerLogo.svg' /></div>
<div class='shareServiceDescription'>Messenger</div>
</div>
<div class='shareService'>
<div class='shareServiceLogoBox'><img class='shareServiceLogoImage' src='static/shareAppImages/WhatsAppLogo.svg' /></div>
<div class='shareServiceDescription'>WhatsApp</div>
</div>
</div>
</div>
<!-- END SERVICES BOX -->
<!--<div class='shareBoxSeparator' style='padding:0;'><hr /></div>-->
<!-- WINDOWS STORE BOX -->
<div id='windowsStoreBox'>
<p>
<svg class='windowsStoreLogo' xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 210 210" width="18px" height="18px"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,210v-210h210v210z" fill="none"/><g fill="#ffffff"><g id="surface1"><path d="M90.36255,26.32691c-1.56372,0.10254 -3.15307,0.43579 -4.7168,0.94848l-13.125,4.35791c-8.02368,2.69165 -13.45825,10.25391 -13.45825,18.68774v21.58447l-26.25,3.69141v98.18116l118.125,16.53442l26.25,-8.66455v-113.15186l-26.25,-9.43359l-13.125,1.8457v-8.4082c0,-9.92066 -7.51098,-17.81616 -16.56006,-19.37988c-3.02491,-0.5127 -6.20362,-0.33325 -9.35669,0.71777l-3.74267,1.2561c-3.05054,-4.46045 -7.8186,-7.61352 -13.15063,-8.53638c-1.51245,-0.25634 -3.05054,-0.33325 -4.6399,-0.23071zM91.43921,39.375c3.76831,-0.35888 6.99829,2.48657 6.99829,6.5625v20.48218l-26.25,3.66577v-19.76441c0,-2.84546 1.7688,-5.3064 4.48609,-6.22925l13.125,-4.35791c0.56396,-0.20508 1.1023,-0.30762 1.64063,-0.35889zM117.68921,45.9375c3.76831,-0.33325 6.99829,2.48657 6.99829,6.5625v10.25391l-13.125,1.82007v-16.79077l4.48609,-1.48681c0.56396,-0.20508 1.1023,-0.30762 1.64063,-0.35889zM149.52759,72.49512l14.53491,5.22949v94.43848l-14.32984,4.7168l-103.79516,-14.53491v-75.31494zM124.6875,89.23462l-32.8125,4.61426v24.27612h32.8125zM85.3125,94.74609l-26.25,3.69141v19.6875h26.25zM59.0625,124.6875v19.6875l26.25,3.69141v-23.37891zM91.875,124.6875v24.27612l32.8125,4.61426v-28.89038z"/></g></g></g></svg>
Get apps in store
</p>
</div>
<!-- END WINDOWS STORE BOX -->
<!-- clearing div -->
<div id='styleRuleDiv' style='display:none;'></div>
<script src='static/js/sharebox.js'></script>
</body>
</html>
I'm not sure if I've misunderstood, but you because you are using fix and absolute they are excluded from the normal document flow.
So you can easily restrict the height of #servicesBox. to prevent it from touching the bottom.
See fiddle: https://jsfiddle.net/16sn87pa/
I would like to put 2 buttons div (register and login) on my banner and center. However I think that I already have a problem with my blocks on my html ??
Here is an overview of my website in below.
screenshot:
My first problem is that I don't can to use the margin-left or margin-right to move my button "register" or "login" for center.
My problem comes perhaps from code HTML, Is it a problem with my blocks ?
Here is my code HTML
<div class="my-banner">
<img class="banner" src="images/slider.jpg"/>
<div class="transparent"></div>
<img class="picture-logo" src="images/logo.png"/>
<div class="container">
<div class="myButtonRegister">REGISTER</div>
<div class="myButtonLogin">LOGIN</div>
<div class="topnav">
<a class="active" href="index.php">HOME</a>
ABOUT US
INVESTEMENT PLAN
NEWS
FAQS
RULES
CONTACT US
</div>
</div>
</div>
Here is my code CSS
.myButtonRegister{
margin-top: 342px;
float: left;
background-color: #C22312;
color: white;
height: 48px;
width: 168px;
text-align: center;
color: white;
font-family: 'Pridi', serif;
font-size: 26px;
padding-top: 10px;
word-spacing: 0px;
}
.myButtonRegister a {
color: #f2f2f2;
text-decoration: none;
}
.myButtonLogin{
margin-top: 342px;
float: left;
background-color: black;
color: white;
height: 48px;
width: 168px;
text-align: center;
color: white;
font-family: 'Pridi', serif;
font-size: 26px;
padding-top: 10px;
word-spacing: 0px;
}
Do you have an idea plase ?
Just add a father box to your buttons and use flex to align your buttons. Here is an example:
.container {
height: 200px;
width: 100%;
background: #eee;
}
.container .subcontainer {
display: flex;
height: 100%;
align-items: center;
justify-content: center;
}
<div class="container">
<div class="subcontainer">
<button>Login</button>
<button>Register</button>
</div>
<!--NAV-->
</div>
Try following code for good design and set maximum height & width image in banner no issues create for this type of design this is the right way.
.myButtonRegister{
float: left;
background-color: #C22312;
color: white;
height: 48px;
width: 168px;
text-align: center;
color: white;
font-family: 'Pridi', serif;
font-size: 26px;
padding-top: 10px;
word-spacing: 0px;
}
.myButtonRegister a {
color: #f2f2f2;
text-decoration: none;
}
.myButtonLogin{
float: left;
background-color: black;
color: white;
height: 48px;
width: 168px;
text-align: center;
color: white;
font-family: 'Pridi', serif;
font-size: 26px;
padding-top: 10px;
word-spacing: 0px;
}
.button-action {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
-webkit-transform: translate(-50%,-50%);
-moz-transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
}
<div class="my-banner">
<div class="banner-image">
<img class="banner" src="images/slider.jpg"/>
<div class="button-action">
<div class="myButtonRegister">REGISTER</div>
<div class="myButtonLogin">LOGIN</div>
</div>
</div>
<div class="transparent"></div>
<img class="picture-logo" src="images/logo.png"/>
<div class="container">
<div class="topnav">
<a class="active" href="index.php">HOME</a>
ABOUT US
INVESTEMENT PLAN
NEWS
FAQS
RULES
CONTACT US
</div>
</div>
</div>
Using position:absolute remove margin-top and give parent div to height and position:relative
.my-banner{
position:relative;
height: 450px;
}
.btnBox{
position: absolute;
left: 0px;
right: 0px;
top: 0px;
margin: auto;
bottom: 0px;
height: 85px;
width: 336px;
}
.myButtonRegister{
float: left;
background-color: #C22312;
color: white;
height: 48px;
width: 168px;
text-align: center;
color: white;
font-family: 'Pridi', serif;
font-size: 26px;
padding-top: 10px;
word-spacing: 0px;
}
.myButtonRegister a {
color: #f2f2f2;
text-decoration: none;
}
.myButtonLogin{
float: left;
background-color: black;
color: white;
height: 48px;
width: 168px;
text-align: center;
color: white;
font-family: 'Pridi', serif;
font-size: 26px;
padding-top: 10px;
word-spacing: 0px;
}
<div class="my-banner">
<img class="banner" src="images/slider.jpg"/>
<div class="transparent"></div>
<img class="picture-logo" src="images/logo.png"/>
<div class="container">
<div class="btnBox">
<div class="myButtonRegister">REGISTER</div>
<div class="myButtonLogin">LOGIN</div>
</div>
<div class="topnav">
<a class="active" href="index.php">HOME</a>
ABOUT US
INVESTEMENT PLAN
NEWS
FAQS
RULES
CONTACT US
</div>
</div>
</div>
Please help to convert the below markup to be responsive across various screens using media queries, also please feel free to update the styles for the mark up where ever required:
Outstanding concerns with the below code are:
Code is not responsive
Styles break specially with in the date and time section of the
markup. Specifically, these css classes break across the screen
.downtime-styles & .date-container & .date-range & .date-month &
.date-time & .date-day classes specified below in the CSS
.downtime-styles{
text-align: center;
padding-bottom: 30px;
color: #007599;
font-family: Univers LT W01_55 Roman1475956,Arial,serif;
}
.date-container {
display: inline-block;
text-align: center;
color: #007599;
font-family: Univers LT W01_55 Roman1475956,Arial,serif;
}
.date-range {
height: 100%;
display: flex;
padding-left: 15px;
-webkit-box-pack: center;
justify-content: left;
-webkit-box-align: center;
align-items: center;
}
.date-month {
width: 100%;
font-size: 14px;
text-transform: uppercase;
padding-top: 30px;
margin: 0;
}
.date-time {
width: 100%;
font-size: 14px;
text-transform: uppercase;
padding-top: 0px;
margin: 0;
}
.date-day {
font-size: 24px;
padding-bottom: 0px;
margin-bottom: 0;
}
.div-div {
padding-top: 20px;
padding-left: 40px;
font-size: 100%;
font: inherit;
}
.main-div{
position: relative;
margin-top: 10px;
display: flex;
margin-right: 0px;
margin-left: 0px;
height: 125px;
border: 1px solid #A9A9A9;
border-radius: 12px;
overflow: hidden;
background-color: #f8f8f8;
}
.main-div-summary{
position: relative;
margin-top: 10px;
margin-right: 0px;
margin-left: 0px;
height: 125px;
border: 1px solid #A9A9A9;
border-radius: 12px;
background-color: #f8f8f8;
}
.main-box{
background-color: #2cbc85;
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 30px;
}
.p-box{
transform-origin: 0 50%;
position: absolute;
font-weight: bold;
top: 0;
bottom: 0;
height: 30px;
line-height: 30px;
margin: auto;
transform: rotate(-90deg) translate(-50%,50%);
color: black;
text-transform: uppercase;
font-size: 16px;
font-family: Univers LT W01_65 Bold1475968,Arial,serif;
}
.title-class{
font-size: 20px;
}
.pipeline-item-section{
height: 100%;
padding-top: 15px;
padding-left: 70px;
padding-bottom: 15px;
display: flex;
flex-direction: column;
justify-content: space-between;
color: #000f2b;
font-family: Univers LT W01_45 Light1475944,Arial,serif;
}
.light-font{
font-weight: normal;
margin: 0px;
font-weight: 100;
font-family: Arial;
}
<div class="row main-div">`enter code here`
<div class="main-box">
<p class="p-box"><span>COMPLETE</span></p>
</div>
<div class="col-xs-3 text-right pipeline-item-section">
<p class="title-class"><span>TITLE OF EVENT</span></p>
</div>
<div class="col-xs-3 pipeline-item-section">
<p class="title-class"><a class="hyperlink-
text">XYZLMNOP</a></p>
<div>
<p class="light-font"><span>Name: </span>ABC</p>
<p class="light-font"><span>Type: </span>XYZ</p>
</div>
</div>
<div class="col-xs-3 pipeline-item-section">
<p class="title-class">Users Notified: <a
class="hyperlink-text">4</a></p>
<div>
<p class="light-font"><span>Impacted Count: </span>
<span>3</span></p>
<p class="light-font"><span>Impacted List: </span>
<span>1</span></p>
</div>
</div>
<div class="col-xs-3 date-range">
<div class="div-div">
<div class="date-container">
<p class="date-month">JUNE</p>
<p class="date-day">2</p>
<p class="date-time">10 AM</p>
</div>
<i class="fa fa-long-arrow-right"></i>
<div class="date-container">
<p class="date-month">JUNE</p>
<p class="date-day">3</p>
<p class="date-time">12 PM</p>
</div>
<div class="downtime-styles"><span>Downtime:
</span>2 hours</div>
</div>
<div class="button-styles btn-group flex-btn-group-
container">
<button type="submit" replaceUrl="true">
<span class="fa fa-remove"></span>
</button>
<button type="submit" replaceUrl="true">
<span class="fa fa-pencil"></span>
</button>
</div>
</div>
</div>