I realized while trying to create a menu using SVG elements inside an a tag
that this had a bit more of height that the svg. It turned out that to fix it
I had to set the content of <a> to display: flex.
IMG.displayed {
display: block;
margin-left: auto;
margin-right: auto }When you have a DOM element that doesn't propagates the focus and blur events and you want it to do so, you can add to it the tabindex attribute (with a tabindex of -1 will do the trick)
.center {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}Add this class to you css
.row-eq-height {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.box {
position:relative;
}
.bet_time {
position:absolute;
bottom:0;
right:0;
}
The way this works is that absolutely positioned elements are always positioned with respect to the first relatively positioned parent element, or the window. Because we set the box's position to relative, .bet_time positions its right edge to the right edge of .box and its bottom edge to the bottom edge of .box
How to kept the footer at the bottom even though your content doesn't fill the whole height of the display
<body>
<div class="content">
content
</div>
<footer class="footer"></footer>
</body>html {
height: 100%;
}
body {
min-height: 100%;
display: flex;
flex-direction: column;
}
.content {
flex: 1;
}- An alternative with just css Sticky footer - CSS tricks
<body>
<header></header>
<article></article>
<footer></footer>
</body>body {
height:100%;
}
header {
height: 50px;
}
footer{
height: 50px;
}
article{
height:100%;
/* The header and footer height respectively */
margin-bottom: -50px;
margin-top: -50px;
}This is a really simple implementation. Do not style your web by targeting tags with your css :P
##Align form elements
<form class="user-form">
<div class="field">
<label for="firstname">First Name:</label>
<input name="firstname" type="text" size="50" autofocus />
</div>
<div class="field">
<label for="lastname">Last Name:</label>
<input type="text" name="lastname" size="50" />
</div>
<div class="field">
<label for="birthdate">Birth Date:</label>
<input type="date" name="bdate" size="50" />
</div>
<form>
.user-form { padding:20px; }
.user-form .field { padding: 4px; margin:1px; background: #eee; }
.user-form .field label { display:inline-block; width:120px; margin-left:5px; }
.user-form .field input { display:inline-block; }
The solution is adding a clear: both; div after the div with floated elements
The CSS importance is at follows
attributes < stylesheet < inline css
p:not(:last-child){
<!-- Some rules here -->
}This code will select all the p tags but the ones that are the last child of
its parent.
I had an issue with flexbox which was not growing to items equally. The problem
was flex-basis which is the size of the item provious application of flex-grow.
The way of fixin this was:
.flexbox-item{
flex-grow: 1;
flex-basis: 0;
}