HTML CSS stop watch - html

I was trying to style and align the header with
(i) stop watch to the right along with "Login" link,
(ii) the logo to the left along with a link to "Home" and
(iii) the content with logo and form would be in the center in body part.
Tried to float and align but it just messed up, could not find what I am making error new bee here, any help will be appreciated thank you.
**update: Have been trying to debug, it looks like
html code for header messes up the layout of the header and
while refreshing it looks like something is overlapping the style.
The header format look to be overlapped with some styling
but could not find the exact error and any help is appreciated. Thank You**
HTML CODE for header
<header class="navbar navbar-fixed-top navbar-inverse">
<div class="container">
<%= link_to image_tag("images.jpeg", alt: "Logo"),
id: "logo" %>
<nav>
<ul class="nav navbar-nav pull-left">
<li><%= link_to "Home", root_path %></li>
<ul class="nav navbar-nav pull-right">
<li><%= link_to "Log in", users_path %></li>
</ul>
<ul class="nav navbar-nav pull-right">
<li> <!-- Lets make a simple stopwatch using CSS3 -->
<!-- Time for the markup -->
<!-- The core logic is a simple div containing numbers being moved
using keyframe animations. The numbers have space between them so that they
can be aligned vertically easily by reducing the container width. Lets
wrap up the 'numbers' in a cell to display only 1 digit-->
<!-- We will replicate the digits now -->
<div class="container">
<!-- time to add the controls -->
<input id="start" name="controls" type="radio" />
<input id="stop" name="controls" type="radio" />
<input id="reset" name="controls" type="radio" />
<div class="timer">
<div class="cell">
<div class="numbers tenhour moveten">0 1 2 3 4 5 6 7 8 9</div>
</div>
<div class="cell">
<div class="numbers hour moveten">0 1 2 3 4 5 6 7 8 9</div>
</div>
<div class="cell divider"><div class="numbers">:</div></div>
<div class="cell">
<div class="numbers tenminute movesix">0 1 2 3 4 5 6</div>
</div>
<div class="cell">
<div class="numbers minute moveten">0 1 2 3 4 5 6 7 8 9</div>
</div>
<div class="cell divider"><div class="numbers">:</div></div>
<div class="cell">
<div class="numbers tensecond movesix">0 1 2 3 4 5 6</div>
</div>
<div class="cell">
<div class="numbers second moveten">0 1 2 3 4 5 6 7 8 9</div>
</div>
<div class="cell divider"><div class="numbers">:</div></div>
<div class="cell">
<div class="numbers milisecond moveten">0 1 2 3 4 5 6 7 8 9</div>
</div>
<div class="cell">
<div class="numbers tenmilisecond moveten">0 1 2 3 4 5 6 7 8 9</div>
</div>
<div class="cell">
<div class="numbers hundredmilisecond moveten">0 1 2 3 4 5 6 7 8 9</div>
</div>
</div>
<!-- Lables for the controls -->
<div id="timer_controls">
<label for="start">Start</label>
<label for="stop">Stop</label>
<label for="reset">Reset</label>
</div>
</div>
<!-- Lets load up prefixfree first -->
<script src="http://thecodeplayer.com/uploads/js/prefixfree.js" type="text/javascript"></script>
</nav>
</header>
</li>'
CSS CODE
/* mixins, variables, etc. */
$gray-medium-light: #eaeaea;
#mixin box_sizing {
-moz-boz-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/* universal */
html {
overflow-y: scroll;
}
body {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #167EA8), color-stop(1, #0E0754) );
background:-moz-linear-gradient( center top, #167EA8 5%, #0E0754 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#167EA8', endColorstr='#0E0754');
background-color:#167EA8;
color:#FFFBFA;
font-size: 12px;
font-weight: bold;
}
section {
overflow: auto;
}
textarea {
resize: vertical;
}
.center {
text-align: center;
h1 {
margin-bottom: 10px;
}
}
/* header */
#logo small{
float: left;
margin-right: 2px;
font-size: 1.0em;
color: white;
text-transform: uppercase;
letter-spacing: 3px;
padding-top: 15px;
font-weight: bold;
&:hover {
color: white;
text-decoration: none;
}
}
* {margin: 0; padding: 0;}
.container {
padding: 100px;
text-align: center;
}
.timer {
padding: 10px;
background: linear-gradient(top, #222, #444);
overflow: hidden;
display: inline-block;
border: 7px solid #efefef;
border-radius: 5px;
position: relative;
box-shadow:
inset 0 -2px 10px 1px rgba(0, 0, 0, 0.75),
0 5px 20px -10px rgba(0, 0, 0, 1);
}
.cell {
/*Should only display 1 digit. Hence height = line height of .numbers
and width = width of .numbers*/
width: 0.60em;
height: 40px;
font-size: 50px;
overflow: hidden;
position: relative;
float: left;
}
.numbers {
width: 0.6em;
line-height: 40px;
font-family: digital, arial, verdana;
text-align: center;
color: #fff;
position: absolute;
top: 0;
left: 0;
/*Glow to the text*/
text-shadow: 0 0 5px rgba(255, 255, 255, 1);
}
/*Styles for the controls*/
#timer_controls {
margin-top: -5px;
}
#timer_controls label {
cursor: pointer;
padding: 5px 10px;
background: #efefef;
font-family: arial, verdana, tahoma;
font-size: 11px;
border-radius: 0 0 3px 3px;
}
input[name="controls"] {display: none;}
/*Control code*/
#stop:checked~.timer .numbers {animation-play-state: paused;}
#start:checked~.timer .numbers {animation-play-state: running;}
#reset:checked~.timer .numbers {animation: none;}
.moveten {
/*The digits move but dont look good. We will use steps now
10 digits = 10 steps. You can now see the digits swapping instead of
moving pixel-by-pixel*/
animation: moveten 1s steps(10, end) infinite;
/*By default animation should be paused*/
animation-play-state: paused;
}
.movesix {
animation: movesix 1s steps(6, end) infinite;
animation-play-state: paused;
}
/*Now we need to sync the animation speed with time speed*/
/*One second per digit. 10 digits. Hence 10s*/
.second {animation-duration: 10s;}
.tensecond {animation-duration: 60s;} /*60 times .second*/
.milisecond {animation-duration: 1s;} /*1/10th of .second*/
.tenmilisecond {animation-duration: 0.1s;}
.hundredmilisecond {animation-duration: 0.01s;}
.minute {animation-duration: 600s;} /*60 times .second*/
.tenminute {animation-duration: 3600s;} /*60 times .minute*/
.hour {animation-duration: 36000s;} /*60 times .minute*/
.tenhour {animation-duration: 360000s;} /*10 times .hour*/
/*The stopwatch looks good now. Lets add some styles*/
/*Lets animate the digit now - the main part of this tutorial*/
/*We are using prefixfree, so no need of vendor prefixes*/
/*The logic of the animation is to alter the 'top' value of the absolutely
positioned .numbers*/
/*Minutes and Seconds should be limited to only '60' and not '100'
Hence we need to create 2 animations. One with 10 steps and 10 digits and
the other one with 6 steps and 6 digits*/
#keyframes moveten {
0% {top: 0;}
100% {top: -400px;}
/*height = 40. digits = 10. hence -400 to move it completely to the top*/
}
#keyframes movesix {
0% {top: 0;}
100% {top: -240px;}
/*height = 40. digits = 6. hence -240 to move it completely to the top*/
}
/*Lets use a better font for the numbers*/
#font-face {
font-family: 'digital';
src: url('http://thecodeplayer.com/uploads/fonts/DS-DIGI.TTF');
}
Body part, Home Page
<% provide(:title, "Home") %>
<div class="center jumbotron">
<h1><%= link_to image_tag("logoo.jpg", alt: "Logo") %></h1>
<h2>
Interviewer Name <%= text_field_tag('input_second', 'First Middle Last Name', class: 'input-large') %>
</h2>
<h2>
Interviewee Name <%= text_field_tag('input_second', 'First Middle last Name', class: 'input-large') %>
</h2>
<h2>
Date <%= text_field_tag('input_second', 'mm/dd/yyyy', class: 'input-large') %>
</h2>
<%= link_to "Begin Interview Now", about_path, class: "btn btn-lg btn-primary" %>
</div>

Related

Put text and form next to photo using bootstrap

This is my HTML:
<div class="row trolibelanja">
<div class="col-md-3">
<img src="http://2.bp.blogspot.com/-WGiyrP7xGOk/VQlHwjgporI/AAAAAAAABHI/zLGXTH0-H2w/s1600/Mie%2BAyam%2B(4).jpg" class="detailfoto">
</div>
<div class="col-md-4">
<p class="detailnama">Mie Ayam Bakso</p>
<p class="detailtoko">Toko Bu Lastri</p>
</div>
<div class="col-md-2">
<p class="detailharga">Rp. 30.000</p>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-btn">
<button class="btnjumlah" type="button">-</button>
</span>
<input type="text" class="form-control jumlah" value="1">
<span class="input-group-btn">
<button class="btnjumlah" type="button">+</button>
</span>
</div>
</div>
<div class="col-md-1">
</div>
</div>
This is my css:
body{
background-color: #661f61 !important;
font-family: 'Saira Extra Condensed', sans-serif !important;
}
.container-fluid.keranjang {
background-color: #e9e9e9;
flex: 1;
}
.container.keranjang {
}
.row.trolibelanja {
background-color: #e1e1e1;
position: relative;
padding-top: 10px;
padding-bottom: 23px;
}
.row.trolibelanja:after{
background-image: -webkit-linear-gradient(135deg, #6e1c64 25%, #e27f31 25%) !important;
position: absolute;
content: " ";
width: 100%;
height: 15px;
bottom: 0;
}
.detailfoto {
width: 100%;
height: 110px;
border: 6px solid white;
}
.detailnama{
font-size: 20px;
font-weight: bold;
}
.detailtoko{
line-height: 20px;
margin: -17px 0px;
}
.detailharga{
font-size: 20px;
font-weight: bold;
text-align: center;
}
.input-group .jumlah {
width: 50%;
text-align: center;
}
.input-group .btnjumlah {
background-color: #e27f31;
color: white;
border: 0;
font-size: 20px;
font-weight: bold;
padding: 0px 10px;
height: 100%;
}
I am trying to put text and form next to photo using bootstrap, as in photo below:
enter image description here
My code result:
enter image description here
Please let me know what am I missing? I tried each combination of display that i know, but they wouldn't work. Thank you
Arrange your columns properly. And you will be good. put image in one column (col-md-3 in this case) and rest of the content in another (col-md-9), then put all rest of the content in a new row. I would suggest that you have a better understanding of the rows and columns from bootstrap website.
https://www.w3schools.com/bootstrap/bootstrap_grid_system.asp
<div class="row trolibelanja">
<div class="col-md-3">
<img src="http://2.bp.blogspot.com/-WGiyrP7xGOk/VQlHwjgporI/AAAAAAAABHI/zLGXTH0-H2w/s1600/Mie%2BAyam%2B(4).jpg" class="detailfoto">
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-4">
<p class="detailnama">Mie Ayam Bakso</p>
<p class="detailtoko">Toko Bu Lastri</p>
</div>
<div class="col-md-2">
<p class="detailharga">Rp. 30.000</p>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-btn">
<button class="btnjumlah" type="button">-</button>
</span>
<input type="text" class="form-control jumlah" value="1">
<span class="input-group-btn">
<button class="btnjumlah" type="button">+</button>
</span>
</div>
</div>
</div>
</div>
</div>
Add flex-wrap: nowrap; to your .row.trolibelanja like this:
.row.trolibelanja {
background-color: #e1e1e1;
position: relative;
padding-top: 10px;
padding-bottom: 23px;
flex-wrap: nowrap;
}
I made codepen example with your code: https://codepen.io/anon/pen/wPZoXX
i ran your code on bootsnipp and found everything is placed side by side to each other, except for the fact that you did not add img-responsive to the image class. and that the below code is distorting your design.
.row.trolibelanja:after{
background-image: -webkit-linear-gradient(135deg, #6e1c64 25%, #e27f31 25%) !important;
position: absolute;
content: " ";
width: 100%;
height: 15px;
bottom: 0;
}
dont you what you intent designing with that, but i think you need to run a check that css code .
when i added your css to it, it distort the whole code.
first review your CSS is well written , targeting the right class.
second add img-responsive to the img class and i think you are good
to go.

align equal column without using table

I have li like this
<li>0 - 10 Years old</li>
<li>11 - 20 Years old</li>
They have different lengths. I want to center 2 column each row and align them left. But my attempt is not perfect, due to different length they aren't align left equally.
I thought of using table but what's a modern solution? Note that I didn't use any css framework for this.
https://jsfiddle.net/coeh77Lp/
Just update CSS in your fiddle to
https://jsfiddle.net/coeh77Lp/3/
ul {
width: 400px;
column-count: 2;
column-gap: 10px;
}
You can use a fixed width for the li:
https://jsfiddle.net/w25m1a81/1/
You could set the float property of each selected <li> as left or right.
Also remember to specify nth-child(2n-1) property to give a table like alignment.
.li{
float: left;
}
li:nth-child(2n){
float right
}
also display: inline-block can be use:
.li{
display: inline-block;
width: 150px;
height: 75px;
margin: 10px;
}
Also providing fixed width, height and margin for the container will improve the alignment
There are some adjustments we should go through so you understand how to achieve the solution you want:
Avoid inline css styles like on the <ul>
Mixing list markup with a lot of other elements can create chaotic code very fast, lets rename all <li> to <div>.
Next we want to wrap all the numeric vales in a container too, because then we have more control over the layout: e.g. <span class="numerics">51 - 60</span>
Now we build up our flexible grid system. We can use the .customLegend containers for this but I would recommend to add a new class for columns so you can separate your individual styles from those for the layout. https://www.sitepoint.com/understanding-css-grid-systems/
I added some styles for free, you can go though the css. I created a jsfiddle too if you want to try further adjustments on your own: https://jsfiddle.net/coeh77Lp/2/
.customLegend {
float: left;
width: 50%;
max-width: 170px; /* stack up cols if there is enough space */
margin-bottom: 5px;
}
.customLegend .symbol {
background: #333333;
display: inline-block;
width: 10px;
height: 10px;
border-radius: 5px;
margin-right: 3px;
}
.numerics {
text-align: right; /* better readability */
min-width: 50px;
display: inline-block;
padding: 2px 4px 2px 2px;
margin-right: 2px;
border-bottom: 2px solid #ddd;
}
.customLegend .label {
display: inline-block;
margin-right: 20px;
}
<div class="customLegend">
<span class="symbol" style="background: rgb(51, 51, 51);"></span>
<div class="label"><span class="numerics">0 - 10</span> Years old</div>
</div>
<div class="customLegend">
<span class="symbol" style="background: rgb(102, 102, 102);"></span>
<div class="label"><span class="numerics">11 - 20</span> Years old</div>
</div>
<div class="customLegend">
<span class="symbol" style="background: rgb(153, 153, 153);"></span>
<div class="label"><span class="numerics">21 - 30</span> Years old</div>
</div>
<div class="customLegend">
<span class="symbol" style="background: rgb(221, 221, 221);"></span>
<div class="label"><span class="numerics">31 - 40</span> Years old</div>
</div>
<div class="customLegend">
<span class="symbol" style="background: rgb(238, 238, 238);"></span>
<div class="label"><span class="numerics">41 - 50</span> Years old</div>
</div>
<div class="customLegend">
<span class="symbol" style="background: red;"></span>
<div class="label"><span class="numerics">51 - 60</span> Years old</div>
</div>
<div class="customLegend">
<span class="symbol" style="background: blue;"></span>
<div class="label"><span class="numerics">61 - 70</span> Years old</div>
</div>
<div class="customLegend">
<span class="symbol" style="background: pink;"></span>
<div class="label"><span class="numerics">71 - 80</span> Years old</div>
</div>
<div class="customLegend">
<span class="symbol" style="background: green;"></span>
<div class="label"><span class="numerics">81 - 0</span> Years old</div>
</div>

Grid Breakpoints not covering width of screen

Technologies:
Bootstrap 3
Less
Jade
Angular
Issue:
I'm using .col-xs-12.col-md-6 for the section.
For some reason when it should switch from .col-md-6 and .col-xs-12 should be applied so that the column can stretch the full width of the screen, the layout doesn't spread out until 743 screen width. (It should go full width at 991px or if i'm wrong atleast 767px screen width).
I have custom styling on .col-md-6 and apply 49% to the width of that class bc .col-md-5 was too small and .col-md-6 was too large to add the needed 20px margin space in between. (styling guidelines).
I removed the width: 49%; when seeing what would happen at the 992 and 768 break point and there is nothing.
It just breaks at random breakpoints.
(I've tested where it breaks for col-lg-6 and col-xl-6 or 5 .. just to test it out and it continues to break in break point areas not connected to the usual 768, 992, 1200 etc.)
I have removed styling from every place possible to see if thats effecting it ..
This is an include file and so even styling connected to the main page. (I put it back bc that wasn't the cause).
These break point additions have worked in the past I don't know whats wrong now.
My only other alternative is using media queries instead which I will try in the meantime but I am wanting to avoid that.
Update:
I reformatted the code in an entirely separate file from the project and put it in regular html and it worked fine. I copied and pasted the code at the very bottom. I removed angular and left it hard coded so that i can open in the browser quickly. I am thinking it may have something to do with the surrounding files in this project. I copied and pasted the code at the very bottom.
Jade file:
#pizza
.col-xs-12
h3 Other Shops
.col-xs-12.col-md-6(ng-repeat="other in otherShops")
.col-xs-12(ng-repeat="tag in other.tags | limitTo: 1")
img(ng-src="{{tag.sm_active_url}}")
{{tag.name}}
.col-xs-3
img(src="http://www.carlotfinance.com/assets/img/car_placeholder.jpg", alt="placeholder image")
.col-xs-8
h2
a(href="#/shops/{{shop.id}}/detail") {{ other.name }}
.glyphicon.glyphicon-road
.glyphicon.glyphicon-unchecked
p {{ other.address }}
p {{ other.phone }}
button.btn.col-xs-12.makeAppointmentBtn(type='button', ng-controller='makeAppointmentCtrl', ng-click='open()') Make Appointment
Less:
#pizza{
h3{
color: #999;
}
.col-md-6{
background-color: #ffffff;
border-radius: 8px;
margin-bottom: 50px;
padding-left: 0;
padding-right: 0;
// width: 49%;
min-height: 440px;
&:nth-child(even){
margin-right: 20px;
}
h2{
a{
color: #000;
}
a:hover{
text-decoration: none;
}
}
.col-xs-3{
margin-left: 20px;
margin-top: 30px;
img{
width: 100%;
}
}
.btn{
position: absolute;
background-color: #003366;
padding: 10px;
border-radius: 8px;
color: #fff;
bottom: 0;
left: 0;
}
.glyphicon{
color: #999;
font-size: 24px;
}
.col-xs-12{
font-size: 24px;
margin-top: 20px;
img{
margin-left: 20px;
}
}
.col-xs-8{
margin-bottom: 40px;
}
}
}
Reformatted code:
<!DOCTYPE html>
<html class="full" lang="en">
<head>
<title>Pizza</title>
<!-- Bootstrap Core CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="col-xs-12 col-md-6 ng-scope">
<div class="col-xs-12">
<img ng-src="https://garageapi.herokuapp.com/tag_tab_icons/Tools/icon-tool-darkblue-25.png" src="https://garageapi.herokuapp.com/tag_tab_icons/Tools/icon-tool-darkblue-25.png"> Tools</div><!-- end ngRepeat: tag in other.tags | limitTo: 1 -->
<div class="col-xs-3"><img src="http://www.carlotfinance.com/assets/img/car_placeholder.jpg" alt="placeholder image"></div>
<div class="col-xs-8">
<h2>Pizza Place
<div class="glyphicon glyphicon-road"></div>
<div class="glyphicon glyphicon-unchecked"></div>
</h2>
<p>1234 M Ave, Austin, TX 27000</p>
<p>(555) 400 2800</p>
</div>
<button type="button" class="btn col-xs-12 makeAppointmentBtn ng-scope">Make Appointment</button>
</div>
<div class="col-xs-12 col-md-6 ng-scope">
<div class="col-xs-12">
<img ng-src="https://garageapi.herokuapp.com/tag_tab_icons/Tools/icon-tool-darkblue-25.png" src="https://garageapi.herokuapp.com/tag_tab_icons/Tools/icon-tool-darkblue-25.png"> Tools</div><!-- end ngRepeat: tag in other.tags | limitTo: 1 -->
<div class="col-xs-3"><img src="http://www.carlotfinance.com/assets/img/car_placeholder.jpg" alt="placeholder image"></div>
<div class="col-xs-8">
<h2>Pizza Place
<div class="glyphicon glyphicon-road"></div>
<div class="glyphicon glyphicon-unchecked"></div>
</h2>
<p>1234 M Ave, Austin, TX 27000</p>
<p>(555) 400 2800</p>
</div>
<button type="button" class="btn col-xs-12 makeAppointmentBtn ng-scope">Make Appointment</button>
</div>
</body>
</html>

No matter what I try, this image refuses to align to the center

See page (front.html)
Codepen
What the page should look like (Ignore the div highlighting, its structure is not being used)
No matter what or how I try, the "Read More" image (line 61) refuses to center horizontally AND responsively. As in, it's responding to pixel measurements, but not % measurements.
I've looked at around 15 articles by now, and I can't afford to spend any more time fruitlessly. Does anyone have a solution to the fact that the Read More image refuses to center? It should be responsive too. The only reason I can think of as to why it's not centering is because of bootstrap, but I doubt that.
The image is currently in a link tag inside a div that class="read-more". The image seems to ignore the margin-left and margin-right properties entirely.
.read-more img{
display:inline-block;
padding-left:auto;
margin-right:auto;
height:10%;
width:20%;
}
An image should not be centered using the approach you are using. Simply add:
text-align:center;
To the block level container element's CSS rule (not the image's CSS rule).
Text alignment is an inherited CSS property and you use it by applying it to the parent BLOCK LEVEL element (container) of the element that needs alignment. In your case, since you have the image inside of a div, the CSS rule should be applied to the div.
A width of 100% for the container and text-align:center should do:
.read-more img {
height: 10%;
width: 20%;
}
.read-more {
width: 100%;
text-align: center;
}
Updated codepen: http://codepen.io/anon/pen/EKmmMZ
You can apply text-align: center to read-more div to make image to center. Make Sure that the link and image must not have float property used.
Here is the code you exactly need.
Updated codepen: http://codepen.io/anuragscsit/pen/YqVVmv
body {
background-image: url("graphics/Website_background_2,_100_dpi.jpg");
}
body a {
color: rgb(241, 90, 34);
}
body a:hover {
color: rgb(208, 78, 29);
}
body a:visited {
color: rgb(144, 14, 0);
}
.row {
overflow: hidden;
}
[class*="xs-"] {
margin-bottom: -99999px;
padding-bottom: 99999px;
background-color: rgba(255, 255, 255, 0.8);
padding-top: 40px;
}
.row1-imgs img {
height: 60%;
width: 100%;
/*box-shadow: inset 5px 5px 7px rgb(0,256,0);/*the line that breaks .border-blue and .border-orange shadows*/
}
.read-more{text-align:center;}
.read-more img {
display: inline-block;
padding-left: auto;
margin-right: auto;
height: 10%;
width: 20%;
}
.read-more div {
background-color: green;
margin-left: 20px;
}
.row1 p {
text-align: justify;
margin-top: 20px;
padding-left: 15px;
padding-right: 15px;
}
.row2 {
text-align: center;
}
#row3 img {
height: 60%;
width: 100%;
}
[class*="title-"] {
text-shadow: 4px 4px 5px rgb(63, 63, 63);
font-weight: bold;
color: white;
font-family: Serif;
letter-spacing: 2px;
font-size: 130%;
text-align: center;
}
.title-blue,
.blue-border,
.title-orange,
.orange-border {
box-shadow: 5px 5px 7px rgb(117, 117, 117);
}
.title-blue {
background-color: rgb(0, 102, 179);
}
.title-orange {
background-color: rgb(208, 78, 29);
}
.blue-border {
border: 4px solid rgb(0, 102, 179);
}
.orange-border {
border: 4px solid rgb(208, 78, 29);
}
#post1 {
width: 85%;
margin-left: auto;
margin-right: auto;
}
#post1 p {
text-align: justify;
}
#post2 {
width: 50%;
margin-left: auto;
margin-right: auto;
}
.event {
padding-top: 3%;
}
.event p {
font-size: 110%;
}
.eventitle {
font-size: 120%;
font-weight: bold;
}
#post1 .eventitle {
color: rgb(0, 102, 179);
}
#post2 .eventitle {
color: rgb(208, 78, 29);
}
* {
/*border: 1px dotted green;*/
}
/*line 13-21 taken from http://stackoverflow.com/questions/19695784/how-can-i-make-bootstrap-columns-all-the-same-height
*/
<html lang="en">
<head>
<link rel="stylesheet" href="front.css" />
<meta name="" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="icon" href="graphics/Liger head for website masthead.ico" />
<title>Ligerbots</title>
</head>
<body>
<header>
</header>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display...Ross you decide whether this is important or not -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://sonexdjco.com/" target="_blank">
<img id="brand-image" src="img/bg9.png" alt="Check us out!">
</a>
</div>
<!-- Collect the nav links-->
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="https://www.google.com/maps/dir//MONROE+Restaurant,+450+Massachusetts+Avenue,+Cambridge,+MA+02139/#42.3751756,-71.1304011,10.44z/data=!4m9!4m8!1m0!1m5!1m1!1s0x89e37754659a60b7:0xdf11b00d94f15ff9!2m2!1d-71.1012446!2d42.36351!3e0?hl=en-US"
target="_blank">Get Directions!<span class="sr-only">(current)</span></a></li>
<li><a href="https://sonexdjco.yapsody.com/event/index/34100/spring-fever" target=_blank>Buy Tickets!</a></li>
<li>Overview</li>
<li>Links</li>
<li>Map</li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div style="background-color:rgba(255,255,255,0.8)" class="col-xs-5 col-xs-offset-1">
<div>
<div class="row1">
<div class="title-orange">
LIGERBUILD BLOG
</div>
<span class="row1-imgs"><img class="orange-border" src="graphics/row1col1.gif"/></span>
<p>Work has already begun on the chassis for the 2016 Stronghold robot. Five working groups are preparing the team to hit the ground running on January 9. We have students working on mechanical, electrical, programming and several fixing the road
kill. . . .</p>
</div>
<div>
</div>
</div>
</div>
<div class="col-xs-5">
<div class="row1">
<div class="title-blue">
LIGERBUISNESS BLOG
</div>
<span class="row1-imgs"><img class="blue-border" src="graphics/row1col2.jpg"/></span>
<p>FRC alumnus Ian from Dash Electric visited with his awesome electric longboard in December and told us how he started his company. Students got to ride his board and ask him lots of questions. <a>Read and see more. . .</a></p>
</div>
</div>
</div>
</div>
<div class="read-more">
<img src="graphics/Read_more_button_outlines.gif" />
</div>
<div class="row">
<div style="background-color:rgba(255,255,255,0.8);" class="col-xs-5 col-xs-offset-1">
<div class="row2">
<div class="title-blue">
ANNOUNCMENTS
</div>
<div style="background-color:rgba(255,255,255,0.8)" class="blue-border">
<div id="post1">
<div class="event">
<span class="eventitle">Team Dinners Needed During Build</span>
<p>Please sign up to make team dinners during build season. We eat together as a team on Friday nights at 6:00. Several families can do this together. Please see the signup here.
</div>
<div class="event">
<span class="eventitle">Carpool Drivers Needed</span>
<p>Please sign up to drive carpools from North to South and back, Mondays through Saturdays during build season. Please see details on our carpool page, here.</p>
</div>
<div class="event">
<span class="eventitle">STIMMS Signup Required</span>
<p>All Students must sign up on STIMMS or theey will not be able to attend competitions. Please see details here.</p>
</div>
<div class="event">
<span class="eventitle">No Team Meeting 12/24</span>
<p>There will be no team meeting 12/24 due to Christmas. Team meetings will resume on 1/4/16.</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-5">
<div class="row2">
<div class="title-orange">
UPCOMING EVENTS
</div>
<div style="background-color:rgba(255,255,255,0.8)" class="orange-border">
<div id="post2">
<div class="event">
<span class="eventitle">Visit the Waban Cub Scouts</span>
<p>January 13, 2016, 7-8 p.m.<br/> Waban Library Center</p>
</div>
<div class="event">
<span class="eventitle">Visit to Danger Awesome!</span>
<p>January 23, 2016, 4-6 p.m.<br/> 215 Ranham St. Melrose, MA</p>
</div>
<div class="event">
<span class="eventitle">Whole Foods Fundraiser</span>
<p>Feb. 1-28 10 a.m.-10 p.m.<br/> Whole Foods, Newton Four Corners</p>
</div>
<div class="event">
<span class="eventitle">FRC Competition at WPI</span>
<p>March 11-12, 2016, 9 a.m.-5 p.m.<br/> Worcester Polytechnic Institute<br/> Link to FIRST Livestream here</p>
</div>
<br/>
<br/>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-10 col-xs-offset-1">
<div id="row3">
<div class="blue-border">
<img src="graphics/row3col1.jpg" />
</div>
</div>
</div>
</div>
</div>
</body>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</html>
You need to alter the css line 42 to this
.read-more {
text-align: center;
}
Please use "margin" property to bring it center.It will align the image in order of -Top,Right,Bottom and Left.
.read-more img {
display: inline-block;
float:center;
padding-left: auto;
margin: 0 0 0 40%;
height: 10%;
width: 20%;
}
try this perhaps
.read-more {
margin: 0 20% 0 20%;
}
or any value of percentage that you'd like

Float search bar over menu

i have a theme based on bootstrap 2.2
Now i am customizing it.
When my menubar is scrolled to the top a menubar appears at the top.
When you click on the search bar it expands to a with of 200px ... and slides over the menu bar.
Now i want the same for the normal menubar. But when it gets to long it jumps under the menubar in stead of sliding over it.
How can i change that?
HTML code of the right search bar:
<div class="container">
<div class="row">
<div class="span12">
<nav>
<div id="megamenu">
</nav>
</div>
<div class="spy-left">
<div class="spy-right">
<div class="spyshop">
<div class="shoppingcart">
</div>
<div class="form-search-wrapper">
<form id="form-search-spy" class="form-search" method="get" action="http://h2374118.stratoserver.net/catalogsearch/result/">
<input class="search-query" type="text" name="q" placeholder="Zoeken...">
<button class="btn" onclick="document.getElementById('orm-search-spy').submit()" type="submit">
</form>
</div>
Here is the html code of the menubar which has to be changed:
<div class="container">
<div class="wrapper_w">
<div class="row">
<div class="span12">
<div class="menufront">
<div class="spy-left">
<nav>
<ul class="nav nav-list hidden-desktop">
<div id="megamenu">
<ul id="nav">
...
<div id="menufront" class="pull-right padding-1">
<div class="form-search-wrapper">
<form id="form-search-spy" class="form-search" method="get" action="http://h2374118.stratoserver.net/catalogsearch/result/">
<input class="search-query" type="text" name="q" placeholder="Zoeken...">
<button class="btn" onclick="document.getElementById('orm-search-spy').submit()" type="submit">
<i class="icon-search-2 icon-large"></i>
</button>
</form>
</div>
etc ...
Piece of the css:
#spy .form-search input.search-query:focus {
width: 200px !important;
}
#spy .form-search input.search-query {
border: 2px solid #fff;
border-radius: 4px;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.27);
float: left;
font-size: 12px;
height: 24px;
padding-left: 44px;
transition: all 0.5s ease 0s;
width: 49px;
}
#menufront .form-search input.search-query:focus {
display: inline-block;
float: left !important;
visibility: visible !important;
width: 140px !important;
}
#menufront .form-search input.search-query {
width: 100px !important;
}
Who can help me?
Use absolute positioning; then use property values of top , right and z-index to get desired effect.
you-search-bar {
position: absolute;
right: 0; /* adjust as needed */
top: -25px; /* Adjust as needed to get the number that will keep it above the menu */
z-index: 999; /* Whatever number that keeps it above the menu */
}
Note: As mentioned by Shipow, the parent needs to have a position value of relative.
You'll need to set the float rule in the CSS for that element to:
float: clear
You may have to do some other positioning to get things to look correct after that, but it's difficult to be more specific with seeing the code in action.
You can move it via the position: relative in your css
#spy .form-search input.search-query:focus {
width: 200px !important;
position: relative;
top: 30px;
}