I need to make an H1 with images on both sides.
It needs to be on one line and has to be responsive.
Like this, but the ==== is an image of an small line:
=========HEADER TEXT============
Current code is:
<h1><img src="{{media url="wysiwyg/mintbar.png"}}" alt="" /> of WATCHES & MEN <img src="{{media url="wysiwyg/mintbar.png"}}" alt="" /></h1>
Any idea? Thanks in advance!
Have the images and the h1 title set as inline-blocks: http://jsfiddle.net/
HTML:
<img id="image-surround" src="{{media url="wysiwyg/mintbar.png"}}" alt="" />
<h1>of WATCHES & MEN</h1>
<img id="image-surround" src="{{media url="wysiwyg/mintbar.png"}}" alt="" />
CSS:
#image-surround { display: inline-block;
}
h1 { display: inline-block;
}
Of course, you'll need to have a container for it all to have it properly responsive.
http://jsfiddle.net/qn8dnvmg/4/
HTML:
<div class="container">
<div class="columns onethird">
<img id="image-surround" src="{{media url="wysiwyg/mintbar.png"}}" alt="" />
</div>
<div class="columns onethird">
<h1>of WATCHES & MEN</h1>
</div>
<div class="columns onethird">
<img id="image-surround" src="{{media url="wysiwyg/mintbar.png"}}" alt="" />
</div>
</div>
CSS:
.container { position: relative;
margin: 0 auto;
padding: 0;
width: 960px;
padding-left: 10px;
padding-right: 10px;
}
.container .column, .container .columns { float: left;
display: inline;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding-left: 2px;
padding-right: 2px;
}
.row { margin-bottom: 20px;
}
.clear { clear: both;
height: 1px;
width: 100%;
}
.container .onehalf.columns { width: 50%; }
.container .full.columns { width: 100%; }
.container .onethird.columns { width: 33.33%; }
.container .twothirds.columns { width: 66.66%; }
.container .onequarter.columns { width: 25%; }
.container .twoquarters.columns { width: 50%; }
.container .threequarters.columns { width: 75%; }
.container .onefifth.columns { width: 20%; }
.container .twofifths.columns { width: 40%; }
.container .threefifths.columns { width: 60%; }
.container .fourfifths.columns { width: 80%; }
.container .oneeight.columns { width: 12.5%; }
.container .twoeights.columns { width: 25%; }
.container .threeeights.columns { width: 37.5%; }
.container .foureights.columns { width: 50%; }
.container .fiveeights.columns { width: 62.5%; }
.container .sixeights.columns { width: 75%; }
.container .seventeights.columns { width: 87.5%; }
.container .onetenth.columns { width: 10%; }
.container .twotenths.columns { width: 20%; }
.container .threetenths.columns { width: 30%; }
.container .fourtenths.columns { width: 40%; }
.container .fivetenths.columns { width: 50%; }
.container .sixtenths.columns { width: 60%; }
.container .seventhtenths.columns { width: 70%; }
.container .eighttenths.columns { width: 80%; }
.container .ninetenths.columns { width: 90%; }
And then your media queries etc.
Related
How can I remove the image's margin from the clickable region, without interfering in the layout of the page?
#logo{
width: auto;
min-height: 80px;
margin: 30px;
height: auto;
box-sizing: border-box;
text-aligh:center;
}
.img1 {
width: 200px;
height: 105px;
}
.img2 {
width: 200px;
height: 105px;
margin-left: 15px;
}
.img3 {
width: 200px;
height: 105px;
margin-left: 15px;
}
<div id="logo"><img class="img1" src="Photos/m.png"/>
<img class="img2"src="Photos/u.png" alt="U"/>
<img class="img3" src="Photos/p.png" alt="P"/>
</div>
15px on the lower left site img2 and img3 can be clicked.
Put the margin to the A tag instead of IMG:
#logo{
width: auto;
min-height: 80px;
margin: 30px;
height: auto;
box-sizing: border-box;
text-align:center;
}
.img1 {
width: 200px;
height: 105px;
}
.img2 {
width: 200px;
height: 105px;
}
.a2, .a3 {
margin-left: 15px;
}
.img3 {
width: 200px;
height: 105px;
}
<div id="logo"><img class="img1" src="Photos/m.png"/>
<a class="a2" href="U"><img class="img2"src="Photos/u.png" alt="U"/></a>
<a class="a3" href="/#"><img class="img3" src="Photos/p.png" alt="P"/></a>
</div>
This simplifies your CSS declarations a bit too. In lieu of setting the margin as you had it, this sets it on <a> elements.
#logo{
width: auto;
min-height: 80px;
margin: 30px;
height: auto;
box-sizing: border-box;
text-aligh:center;
}
.img {
width: 200px;
height: 105px;
}
a:not(:first-of-type) {
margin-left: 15px;
}
<div id="logo">
<img class="img" src="Photos/m.png"/>
<img class="img"src="Photos/u.png" alt="U"/>
<img class="img" src="Photos/p.png" alt="P"/>
</div>
Can't get img inside "head-logo" div to center both vertically amd horizontaly.
i tryed CSS solutions like:
1)
.head-logo img {
margin-left: auto;
margin-right: auto;
display: block;
}
2)
.head-logo img {
vertical-align: middle;
}
3)
.head-logo img {
display: -webkit-flex;
display: -ms-flex;
display: flex;
justify-content: center;
-ms-align-items: center;
align-items: center;
}
etc
<div class="head-container">
<div class="head-logo">
<img src="img\logo.svg" height="70" width="70">
</div>
<div class="head-menu">
</div>
</div>
div {
border: dotted 1px;
}
.head-container {
width: 80%;
height: 100px;
margin: auto;
padding: 5px;
background-color: aqua;
}
.head-logo {
vertical-align: middle;
width: auto;
height: 100px;
background-color: red;
float: left;
}
.head-logo img {
}
Current result is img is stuck to upper left corner of parent div, and I need it centered from all sides.
Probably I'm missing something, quite new to css, looking forward for your help.
div {
border: dotted 1px;
}
.head-container {
width: 80%;
height: 100px;
margin: auto;
padding: 5px;
background-color: aqua;
}
.head-logo {
vertical-align: middle;
width: auto;
height: 100px;
background-color: red;
float: left;
}
.head-logo img {
}
<div class="head-container">
<div class="head-logo">
<img src="https://via.placeholder.com/150x200/O%20https://placeholder.com/" height="70" width="70">
</div>
<div class="head-menu">
</div>
</div>
There is few ways of doing it. My preferred one is this
div {
border: dotted 1px;
}
.head-container {
width: 80%;
height: 100px;
margin: auto;
padding: 5px;
background-color: aqua;
}
.head-logo {
width: 100px;
height: 100px;
background-color: red;
float: left;
overflow: hidden;
position: relative;
}
.head-logo img {
position: absolute;
width: 100%;
height: auto;
top: -50%;
right: -50%;
bottom: -50%;
left: -50%;
margin: auto;
}
<div class="head-container">
<div class="head-logo">
<img src="https://placeholder.com/wp-content/uploads/2018/10/placeholder.com-logo1.png" height="70" width="70">
</div>
<div class="head-menu">
</div>
</div>
Benefits of this solution is that it will always stay at center of parent container it works well in older versions of browsers u can set img width to fixed like "100px" if u want to logo stay at same size or set it to scale to parent container
overflow: hidden; in parent container make sure that bigger picture will not spill out off container
div{
height: 300px;
width: 300px;
padding: 10%;
background: red;
box-sizing: border-box;
}
div img{
height: 100%;
width: 100%;
}
<div>
<img src="https://media.gettyimages.com/photos/trent-boult-of-new-zealand-bowls-during-day-two-of-the-second-test-picture-id1087035928" alt="">
</div>
You could try object-fit - like:
.head-logo img {
object-fit: contain;
height: 100%;
}
Object-fit demo (including image polyfill for ie) https://codepen.io/jakob-e/pen/Pxwzpw
/* object fit polyfill */
// is object fit supported
if (document.body.style.objectFit === undefined) {
// loop through all images
[].slice
.call(document.querySelectorAll('img'))
.map(function (img) {
// image has background-size cover or contain
if (['cover', 'contain']
.indexOf(getComputedStyle(img).backgroundSize) !== -1) {
// use src as background image
img.style.backgroundImage = "url(" + img.src + ")";
// replace src with transparent gif
img.src = 'data:;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
}
});
}
/* add this */
.head-logo img {
height: 100%;
object-fit: contain;
background-size: contain; /* used by polyfill */
background-repeat: no-repeat; /* used by polyfill */
}
div {
border: dotted 1px;
}
.head-container {
width: 80%;
height: 100px;
margin: auto;
padding: 5px;
background-color: aqua;
}
.head-logo {
vertical-align: middle;
width: auto;
height: 100px;
background-color: red;
float: left;
}
<div class="head-container">
<div class="head-logo">
<img src="https://i.pinimg.com/originals/33/b8/69/33b869f90619e81763dbf1fccc896d8d.jpg" height="70" width="70">
</div>
<div class="head-menu">
</div>
</div>
Try this: (ignore long image link :p)
div {
border: dotted 1px;
}
.head-container {
width: 80%;
height: 100px;
margin: auto;
padding: 5px;
background-color: aqua;
}
.head-logo {
width: 150px;
height: 100px;
background-color: red;
float: left;
display: flex;
justify-content: center;
}
.head-logo img {
display: block;
margin: auto;
vertical-align: middle;
}
<div class="head-container">
<div class="head-logo">
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUTExMWFhUWGBgaGBgYFxcXGhcaFRgWFxYYGhcYHSggGBolHRcYITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGy0lICUtLS0tLS8vLS0tLS0tLy0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3+CScpUQkk9BnP8qU2yVthYUkp8wAgqwfSqcd5E00u7JZtD/tUPsc/TNGyjlcYfqC2bSmt+xRMgce8z84q3XVmoMJI5A6YMx1PWkei+kvKP5CoAf8A1TBp5pmtpWmCOufikZiSbHx3APIqZRtQYAXuHUcTkEczRVhcpkAJJHWBnMd6sXijTkEbkxk9BNV9m2WEymfxRkRHeT8xThkDrBDWBGuusbm3DEkBHHMAml1hpaFp3KGZ7jsP61Yb+6aS2UwFEkEEE59vg5oMMrPx0wOOlKVyFqGrxy8rBE81C2wa9rKjB1IhNWbaCfvnOfrWydPChkY6AY/XrXtZXiTMJh1nbQNvT9OAPvApmpICY/z2NZWVhmAxY88Aoxx/k1u26lcScj9R2rysoSIJElvrxBGECZyR9qW27hQNogBRVIA5EjJ98YrKyvKKngajNi4wACRAxGT8zijWEpGZk/zPU1lZRWYxXIh9vdbDvQ5tMciJjsJ4rd3WZxtgTuiIg8YnocfrXtZRLkYaBlCeVkVSFNX3BLbXykny0gT+Ic5kwdx7j+VBX7y3F7du0HhU/H1H9a9rK31GGoAc1XxPLIJ3LH4gFGPfpOKs1jcAncPb9Kysr1XOp4x6k92wCJ60LcIgATWVlJfqNy7m11a728n0jMd4IxSx+SIkAdE9vtWVlbgOpKchU0JFpjwCiFnAOP8Ag0bfFboIkhI4jj5xWVldBzS3GZGpbgFrpydplcn4rRTygIMx3rKyosrkkTm53OiI10bUg2SRwecfejtU1FDowAZ/SsrK0ZWOpTj8rIQFO4Oy6iOBVe8R6eHxAMc+1ZWU1shqdHNnPpHQle/8CC2ESSEgDPXndPseI961YB9TZEiUz79yfevaylLkY3c4mPIxsSC0sIDi4MFwr+iwEkH9aLtdP9AIACwuSY5wBHxisrKMuY0MQajpy1SIVtEgfQH2FBN2aQkgZCp7cn+lZWUiz3J3YhtQFOmAmSBj27VE8xnAxXtZRWT3BBJn/9k=" height="70" width="120">
</div>
<div class="head-menu">
</div>
</div>
I'm working on a responsive template but I have a problem with the widths of my divs and they are all the same size, but they should not be, look at the code snippet. I tried some things but they all don't work :/
Html:
<div class="content">
<div class="col 4">
<div class="top">
<h4>Top</h4>
</div>
<div class="con">
<p class="inner">Content</p>
</div>
</div>
<div class="col 3">
<div class="top">
<h4>Top</h4>
</div>
<div class="con">
<p class="inner">Content</p>
</div>
</div>
<div class="col 3">
<div class="top">
<h4>Top</h4>
</div>
<div class="con">
<p class="inner">Content</p>
</div>
</div>
<div class="col 3">
<div class="top">
<h4>Top</h4>
</div>
<div class="con">
<p class="inner">Content</p>
</div>
</div>
</div>
CSS:
.content {
width: auto;
height: auto;
padding: 10px;
}
.col {
box-shadow: 0 0 3px #bdc3c7;
margin: 5px;
}
.col .4 {
width: 100%;
float: left;
}
.col .3 {
width: 33.33333%;
float: left;
}
.col .2 {
width: 50%;
float: left;
}
.col .1 {
width: 25%;
float: left;
}
.col .top {
height: 40px;
line-height: 40px;
width: 100%;
background: #3498db;
}
.col .top h4 {
padding: 0 10px;
color: #fff;
}
.col .con {
width: 100%;
}
.inner {
padding: 10px;
}
You should change your class names to something like "col-1", "col-2" ... Check this post
Also, your selectors are wrong. With this:
.col .col-1 {}
You are trying to access all the element with "col-1" class inside elements with class "col".
You should be doing:
.col.col-1 {}
To get the elements containing both classes.
This:
.col .4 {
width: 100%;
float: left;
}
.col .3 {
width: 33.33333%;
float: left;
}
.col .2 {
width: 50%;
float: left;
}
.col .1 {
width: 25%;
float: left;
}
Should be this:
.col-4 {
width: 100%;
float: left;
}
.col-3 {
width: 33.33333%;
float: left;
}
.col-2 {
width: 50%;
float: left;
}
.col-1 {
width: 25%;
float: left;
}
or this, which means all col classes that also has another numeric class:
.col.col-4 {
width: 100%;
float: left;
}
.col.col-3 {
width: 33.33333%;
float: left;
}
.col.col-2 {
width: 50%;
float: left;
}
.col.col-1 {
width: 25%;
float: left;
}
Since they're not nested inside the col class. As having classes that starts with a number isn't allowed.
Given the image below, how do I mark up 3 small container so that are fluid and responsive?
Here is my code,
<div class="container-fluid" style=";height: 350px;">
<div class="row-fluid" style="height: 100%;">
<div class="span9" style="height: 100%;">
<div class="row-fluid"style="height: 50%">
<div class="span12" style="height: 100%;">
<div class="span4" style="background-color: violet;height: 100%">
</div>
<div class="span4" style="background-color:green;height: 100%">
</div>
<div class="span4" style="background-color: orange;height: 100%">
</div>
</div>
</div>
<div class="row-fluid" style="background-color: #ffff00;height: 48%;margin-top: 5px">
</div>
</div>
<div class="span3" style="background-color: pink;height: 100%;">
</div>
</div>
</div>
expected output:
My trail is as below.
Note: Please do not use inline CSS as it is not a good practice. convert all the css to classes and apply to the HTML elements
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div style="height: 350px;" class="container-fluid">
<div style="height: 100%;" class="row-fluid">
<div style="height: 100%; float: left; width: 82%;" class="span9">
<div style="height: 50%; width: 100%;" class="row-fluid">
<div style="background-color: violet; height: 100%; float: left; margin: 5px; width: 31%;" class="span4">
</div>
<div style="background-color: green; height: 100%; float: left; margin: 5px; width: 31%;" class="span4">
</div>
<div style="background-color: orange; height: 100%; float: left; margin: 5px; width: 31%;" class="span4">
</div>
</div>
<div style="background-color: rgb(255, 255, 0); float: left; height: 50%; margin: 5px; width: 95%;" class="row-fluid">
</div>
</div>
<div style="background-color: pink; width: 20%; float: left; margin: 5px 5px 5px -34px; height: 100%;" class="span3">
</div>
</div>
</div>
</body>
</html>
You can use this CSS
[class*="span"] {
float: left;
min-height: 1px;
margin-left: 20px;
}
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
width: 940px;
}
.span12 {
width: 940px;
}
.span11 {
width: 860px;
}
.span10 {
width: 780px;
}
.span9 {
width: 700px;
}
.span8 {
width: 620px;
}
.span7 {
width: 540px;
}
.span6 {
width: 460px;
}
.span5 {
width: 380px;
}
.span4 {
width: 300px;
}
.span3 {
width: 220px;
}
.span2 {
width: 140px;
}
.span1 {
width: 60px;
}
.offset12 {
margin-left: 980px;
}
.offset11 {
margin-left: 900px;
}
.offset10 {
margin-left: 820px;
}
.offset9 {
margin-left: 740px;
}
.offset8 {
margin-left: 660px;
}
.offset7 {
margin-left: 580px;
}
.offset6 {
margin-left: 500px;
}
.offset5 {
margin-left: 420px;
}
.offset4 {
margin-left: 340px;
}
.offset3 {
margin-left: 260px;
}
.offset2 {
margin-left: 180px;
}
.offset1 {
margin-left: 100px;
}
.row-fluid {
width: 100%;
*zoom: 1;
}
.row-fluid:before,
.row-fluid:after {
display: table;
line-height: 0;
content: "";
}
.row-fluid:after {
clear: both;
}
.row-fluid [class*="span"] {
display: block;
float: left;
width: 100%;
min-height: 30px;
margin-left: 2.127659574468085%;
*margin-left: 2.074468085106383%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.row-fluid [class*="span"]:first-child {
margin-left: 0;
}
.row-fluid .controls-row [class*="span"] + [class*="span"] {
margin-left: 2.127659574468085%;
}
.row-fluid .span12 {
width: 100%;
*width: 99.94680851063829%;
}
.row-fluid .span11 {
width: 91.48936170212765%;
*width: 91.43617021276594%;
}
.row-fluid .span10 {
width: 82.97872340425532%;
*width: 82.92553191489361%;
}
.row-fluid .span9 {
width: 74.46808510638297%;
*width: 74.41489361702126%;
}
.row-fluid .span8 {
width: 65.95744680851064%;
*width: 65.90425531914893%;
}
.row-fluid .span7 {
width: 57.44680851063829%;
*width: 57.39361702127659%;
}
.row-fluid .span6 {
width: 48.93617021276595%;
*width: 48.88297872340425%;
}
.row-fluid .span5 {
width: 40.42553191489362%;
*width: 40.37234042553192%;
}
.row-fluid .span4 {
width: 31.914893617021278%;
*width: 31.861702127659576%;
}
.row-fluid .span3 {
width: 23.404255319148934%;
*width: 23.351063829787233%;
}
.row-fluid .span2 {
width: 14.893617021276595%;
*width: 14.840425531914894%;
}
.row-fluid .span1 {
width: 6.382978723404255%;
*width: 6.329787234042553%;
}
[class*="span"].hide,
.row-fluid [class*="span"].hide {
display: none;
}
[class*="span"].pull-right,
.row-fluid [class*="span"].pull-right {
float: right;
}
.container {
margin-right: auto;
margin-left: auto;
*zoom: 1;
}
.container:before,
.container:after {
display: table;
line-height: 0;
content: "";
}
.container:after {
clear: both;
}
.container-fluid {
padding-right: 20px;
padding-left: 20px;
*zoom: 1;
}
.container-fluid:before,
.container-fluid:after {
display: table;
line-height: 0;
content: "";
}
.container-fluid:after {
clear: both;
}
I have the following HTML:
<div class="section group">
<div class="col span_1_of_3 articleTeaserBoxColor">
<div class="test2n">
<div class="imgHolder"><img id="NewsArticle_2790_image" class="imgArtThumb" title="" alt="" src="artOne.png" /></div>
<div class="textHolder">
<div class="textHolderTop">Care on the Fast Track</div>
<div class="textHolderBottom">The National Cancer Institute</div>
</div>
</div>
</div>
<div class="col span_1_of_3 articleTeaserBoxColor">
<div class="test2n">
<div class="imgHolder"><img id="NewsArticle_2792_image" class="imgArtThumb" title=" alt="" src="artThree.png" /></div>
<div class="textHolder">
<div class="textHolderTop">Stay Connected</div>
<div class="textHolderBottom">tool for interacting with your provider and following your healthcare</div>
</div>
</div>
</div>
<div class="col span_1_of_3 articleTeaserBoxColor">
<div class="test2n">
<div class="imgHolder"><img id="NewsArticle_2791_image" class="imgArtThumb" title="" alt="" src="artTwo.png" /></div>
<div class="textHolder">
<div class="textHolderTop">Know When Antibiotics Work and When They Don't</div>
<div class="textHolderBottom">If you or your child has a virus, antibiotics will not help you or him/her</div>
</div>
</div>
</div>
</div>
CSS:
.imgArtThumb
{
max-width: 100%;
height: auto;
}
.aTitle
{
font-size: 16px !important;
font-weight: bold;
color: #F67D24;
margin-top: 15px;
margin-bottom: 15px;
}
.test2
{
padding: 8px;
text-align: left;
box-shadow: inset 0 -1px 1px rgba(0,0,0,0.5), inset 0 1px 1px rgba(238,146,85,1);
}
.test2n
{
text-align: left;
height: 95%;
width: 95%;
padding: 2%;
overflow: hidden;
}
.articleTeaserBoxColor
{
vertical-align: top;
box-shadow: inset 0 -1px 1px rgba(0,0,0,0.5), inset 0 1px 1px rgba(238,146,85,1);
}
.test2 p, .test2n p
{
text-align: left;
}
.setP p
{
text-align: left;
padding: 10px 10px 0 0;
}
.setP article
{
text-align: left;
padding: 10px 0 0 0;
}
/* SECTIONS */
.section {
clear: both;
padding: 0px;
margin: 0px;
height: auto;
overflow: auto;
text-align: center;
width: 100%;
}
/* COLUMN SETUP */
.col {
display: block;
/*float:left;*/
display: inline-block;
margin: 1% 0 1% 0;
}
.col:first-child {
margin-left: 0;
}
/* GROUPING */
.group:before, .group:after {
content: "";
display: table;
}
.group:after {
clear: both;
}
.group {
zoom: 1; /* For IE 6/7 */
}
/* GRID OF THREE */
.span_3_of_3 {
width: 100%;
}
.span_2_of_3 {
width: 66.1%;
}
.span_1_of_3 {
width: 32.2%;
}
/* GO FULL WIDTH AT LESS THAN 480 PIXELS */
#media only screen and (max-width: 820px) {
.col {
margin: 1% 0 1% 0%;
padding-bottom: 10px;
}
}
#media only screen and (max-width: 820px) {
.span_3_of_3 {
width: 100%;
}
.span_2_of_3 {
width: 100%;
}
.span_1_of_3 {
width: 98%;
}
.imgArtThumb {
width: 100%;
height: 110px;
}
.setTableCell
{
display: block;
}
}
.imgHolder
{
float: left;
display: inline-block;
width: 43%;
padding-right: 2%;
height: 100%;
}
.textHolder
{
float: left;
display: inline-block;
width: 55%;
height: 100%;
}
.textHolderTop
{
width: 100%;
height: 48%;
text-align: left;
padding-bottom: 2%;
overflow: hidden;
}
.textHolderBottom
{
width: 100%;
height: 48%;
overflow: hidden;
text-align: left;
padding-bottom: 2%;
}
.setTableCell
{
display: table-cell;
}
At full desktop width page this is what I see:
At smaller screen (mobile) this is what I see:
If I remove the text or unchecked table-cell from the developer tool from the image below, it works fine. But I am not sure why the display: block is cancelled out if the screensize matches the condition.
How can I resolve it
In your css, .setTableCell is assigned display:table-cell below the media query part. Move it higher or give the media query a narrower selector; just being inside a media query block does not give it higher priority.