I can not understand how to remove the top and bottom of the strip , and that would be in other places it was normal .
<div class="ma_linenums">
<div class="ma_linenum">
<div class="num">1</div>
<div class="text">Provide ship to zip code</div>
</div>
<div class="ma_linenum">
<div class="num">2</div>
<div class="text">Select Box-n-Go storage containers to be shipped</div>
</div>
<div class="ma_linenum">
<div class="num">3</div>
<div class="text">Confirm who will be receiving the shipment</div>
</div>
<div class="ma_linenum">
<div class="num">4</div>
<div class="text">Confirm all the information provided</div>
</div>
<div class="ma_linenum">
<div class="num">5</div>
<div class="text">Box-n-Go representative will calculate the shipping costs and provide you with a quote</div>
</div>
<div class="ma_linenum">
<div class="num">6</div>
<div class="text">Once we recive your approval, we will shio the items to you</div>
</div>
<div class="clearfix"></div>
</div>
https://jsfiddle.net/h49hsx89/1/
Need result: http://cs624027.vk.me/v624027836/285ae/thJS61-9ct8.jpg
Solution: https://jsfiddle.net/x3596yn4/3/
The following will fix it:
.ma_linenums {
background: url("http://cs624027.vk.me/v624027836/2858b/qWSCfsvYM3I.jpg") repeat-y;
background-size: 1px 90%;
background-position: 27px;
background-repeat: no-repeat;
}
Originally your picture was repeating the entire height of its container. I restrict this via background-repeat: no-repeat and manually set the height to 250px
If you want to make the height of the line resize to the content then change background-size: 1px 250px; to background-size: 1px 90%;
I have made some changes in the code, and use pseudo class instead to obtain the desire result. Check out this jsfiddle: https://jsfiddle.net/h49hsx89/4/
Here is the css I added to make it possible:
.ma_linenum:before {
content : '';
background: url("http://cs624027.vk.me/v624027836/2858b/qWSCfsvYM3I.jpg") repeat-y;
height:22px;
width:1px;
display:block;
position:absolute;
left:13px;
top:-10px;
}
.ma_linenum:first-child:before {content:'';background:none}
Related
I am making a small eastern project. The website is here: My Website.
I need to make some boxes that contain a png picture on top of the background-picture like this:
I set the picture on the col, but I guess I need to make it as a background in CSS, since I cannot build something on top of an img tag:
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<center><img src="https://mimsi.dk/images/logo.jpg" class="img-fluid" alt="Eastern"></center>
</div>
</div>
<div class="row">
<div class="col-md-12">
<img src="https://mimsi.dk/images/eeg.jpg" alt="Eastern game" class="background">
</div>
</div class="row">
<div class="col-md-12" style="border: 1px solid red;">
<h1 style="text-align: center;">FOOTER</h1>
</div>
</div>
</div>
Instead of using the img src tag, I set this in my HTML and CSS:
<div class="col-md-12 bg">
.bg {
background-image: url("https://mimsi.dk/images/eeg.jpg");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
But nothing has worked out yet. How can I set the background-image, so it is not going to the header logo or footer, so I can build my 8 boxes on top?
First there is a mistake in your HTML in this line </div class="row"> i think you got that you can't put class in closing div
Solution
I created a fiddle
Hi I have searched in previous questions and tried multiple ways but I still have trouble setting up opacity of my background image without effecting opacity of font.
this is my html:
<main>
<div class="background">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="center">
<h1>My name</h1>
<h3>this is my website</h3>
<hr>
<button id = "mainButton" type="button" class="btn btn-default btn-lg">Get Started!</button>
</div>
</div>
</div>
</div>
</div>
</main>
and this is css:
.background{
background-image: url("xxx.jpg");
width: 100%;
height:100%;
position:fixed;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
opacity:0.5;
}
*I tried to use rgba(0,0,0,0.5);
*I tried to set up another css rule just for h1, or the div with the text but still the same.
Please can anyone help?
Make the markup like this:
<main>
<div class="background">
</div>
<div class="container">
</div>
</main>
Give to main position: relative;
Give to background div position: absolute;
Fix the rest. You're done.
About background size
You can modify the image background size by background-size and using values like cover, contain, 100%, 100% 100% etc.
If you want to cover all the page, use value 100vh, meaning 100% of the viewport height.
I'm new to coding and figured best way to learn is to get a gig, which I did. I've got some basic (like very basic) HTML & CSS knowledge, but bootstraps layout seemed to fit for what I'm trying to accomplish. Please keep in mind this is my very first project ever(!) when it comes to coding.
So here's the design I'm trying to replicate:
montere.it
I'm interested just in the main page, the actual tiles below the main image to be exact. I can't seem to find the best solution to position 2 tiles with background image, side by side(no gaps), with some h1 text and a small <p> above the background image in the tile, positioned centrally. There will be two more tiles below the initial two.
I SPENT A WEEK looking for similar solutions, but I'm exhausted and confused over all information digested. Can some one just point me in the right direction as to which features to use?
It seems even if I get to position both images, there are always gaps (right or left), there's no way to position the text exactly above the image centrally so it stays in one place when the display is resized and I don't want to cry about the rest.
I have a feeling it's a dumb question to ask, since none of the info I've found provide an exact solution to this question, so probably must be really easy to do and I just can't seem to grasp it.
I do apologize for taking up your time, but I just have no one else to ask.
Cheers!
Please check this out:
<div class="row">
<div class="col-sm-6 col-xs 12 col-img" style="background-color: red">
<h1>Image 1</h1>
</div>
<div class="col-sm-6 col-xs 12 col-img" style="background-color: orange">
<h1>Image 2</h1>
</div>
<div class="col-sm-6 col-xs 12 col-img" style="background-color: green">
<h1>Image 3</h1>
</div>
<div class="col-sm-6 col-xs 12 col-img" style="background-color: yellow">
<h1>Image 4</h1>
</div>
</div>
And add this to your CSS file:
.col-img h1 {
margin-bottom: 0;
margin-top: 0;
text-align: center;
}
In case any one else runs into this problem, here's the fully working solution. I'm just not sure if it will disappear under gjfonte's link, so I want to be safe here:
Here's what was provided by #gjfonte:
<div class="row">
<div class="col-sm-6 col-xs 12 col-img">
<div class="bg-img img-1">
<div class="content">
<h1>Image 1</h1>
</div>
</div>
</div>
<div class="col-sm-6 col-xs 12 col-img">
<div class="bg-img img-2">
<div class="content">
<h1>Image 1</h1>
</div>
</div>
</div>
<div class="col-sm-6 col-xs 12 col-img">
<div class="bg-img img-3">
<div class="content">
<h1>Image 1</h1>
</div>
</div>
</div>
<div class="col-sm-6 col-xs 12 col-img">
<div class="bg-img img-4">
<div class="content">
<h1>Image 1</h1>
</div>
</div>
</div>
</div>
.content {
padding-top: 90px;
color: #fff
}
.content h1 {
margin-bottom: 0;
margin-top: 0;
text-align: center;
}
.col-img .bg-img {
text-align: center;
margin: 0 -15px;
background-position: center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
height: 250px;
}
.bg-img.img-1 {
background-image: url("http://www.montere.it/assets/img/bg-qualitycycle-wrapper.jpg");
}
.bg-img.img-2 {
background-image: url("http://www.montere.it/assets/img/bg-qualitymap-wrapper.jpg");
}
.bg-img.img-3 {
background-image: url("http://www.montere.it/assets/img/bg-recipes-wrapper.jpg");
}
.bg-img.img-4 {
background-image: url("http://www.montere.it/assets/img/bg-journal-wrapper.jpg");
}
I'm having problems styling my page and I'm not sure what to do.
The issue I'm running into is that the container class in Bootstrap has a sizable amount of padding on each side, but I can't seem to reliably remove it. I want the red background to be flush against the grey image, and have blue in the background. The only way I've been able to work around this is by using the CSS property background-clip: content-box but then I begin to run into issues when I start adding things like box-shadows.
This is what I have right now:
This is what I want to have:
Here is my code:
<div class="container content-color">
<div class="row">
<div class="col-md-12">
<img class="img-responsive" src="http://placehold.it/1140x360">
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="circle center-block"></div>
</div>
<div class="col-md-4">
<div class="circle center-block"></div>
</div>
<div class="col-md-4">
<div class="circle center-block"></div>
</div>
</div>
</div>
.circle {
background-color: #48c1b0;
height: 150px;
width: 150px;
border-radius: 50%;
}
body {
background-color: blue;
}
.content-color {
background-color: red;
}
}
JS Fiddle: http://jsfiddle.net/rxvk0w2n/
col-* has a default padding of 15px on both, right side and left side.
So, if you want to remove the padding, simply use this in your css:
.removePaddingRightLeft {
padding-right: 0;
padding-left: 0;
}
And your html:
<div class="col-md-12 removePaddingRightLeft">
<img class="img-responsive" src="http://placehold.it/1140x360"/>
</div>
Updated fiddle
I've a background image for body and a background color for wrapper div.
I haven't set any height for body and I'm using a min-height:1000px for wrapper.
But if wrapper height extends 1000px;, the background color of wrapper is as body background image.
HTML Code:
<body>
<div id="wrapper">
<div id="header">
<div id="headercontainer">
<div id="company"></div>
<div id="tagline"></div>
<div id="navigation"></div>
</div>
</div>
<div id="pagecontainer1"></div>
<div id="footer1"></div>
</div>
Here is the css:
body{
background:#E8EDF0;
margin:0;
width:100%;
background-image: url(http://l1.yimg.com/a/i/ww/met/th/slate/gsprite_pg_slate_20100521.png);
background-repeat: repeat-x;
background-position: 0px -2335px;}
#wrapper{
background-color:#FFF;
min-height:1000px;
width:1008px;
margin:auto;
position:relative;
overflow:visible;
}
How can i fix this background color issue for wrapper.
As the way you coded your page, you can't get the wrapper to cover the full height. So the best way to do it is to make a background image for your full body like this:
grey area##-----white area: 1008px-----###grey area
make it 2000px wide (or more), 1px high, and repeat vertically:
background:#E8EDF0 url(new-background-path.jpg) top center repeat-y;
simply add <div style="clear:both"></div> in pagecontainer1 div. coz i think there are some float div so to clear float use float clear or you can use overflow:hidden; rather than overflow:visible;
<div id="wrapper">
<div id="header">
<div id="headercontainer">
<div id="company"></div>
<div id="tagline"></div>
<div id="navigation"></div>
</div>
</div>
<div id="pagecontainer1">
<div style="clear:both"></div>
</div>
<div id="footer1"></div>
<div style="clear:both"></div>
</div>