I have this website.
It has images.
This is load the image correectly.
<img src="~/images/news2.jpg">
It appends the application name in production server.
Now If I have
<div class="bg" style="background: url(~/images/camels1.jpg)"></div>
it is not loading image ?
I need append application path in the url
Any reason ?
i fixed it by changning html structure.
<div class="col l3 m6 s12">
<div class="new-box new-box-text">
<div class="empty"></div>
<div class="bg">
<img src="~/images/news1.jpg">
</div>
</div>
</div>
and img max-width: fit-content !important;
Related
I used Bootstrap grid to centre the position of the 4 images in Angular. The images align perfectly to the centre in the row when I placed them within the same HTML sheet. However, if I placed them in a different HTML sheet, the 4 images are not exactly positioned in the centre, as I notice they are slightly off to the left.
To summarise, this works (./home.component.html):
<div class="container">
<p class="h2-responsive itemsTitle">Items with free shipping</p>
<hr>
<div class="row">
<div class="col-sm">
<img class="itemCard" src="https://images.unsplash.com/photo-1505429155379-441cc7a574f7?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=0ddea5332a8ab2d09cf5eec6a57d3f9f&auto=format&fit=crop&w=334&q=80">
</div>
<div class="col-sm">
<img class="itemCard" src="https://images.unsplash.com/photo-1505429155379-441cc7a574f7?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=0ddea5332a8ab2d09cf5eec6a57d3f9f&auto=format&fit=crop&w=334&q=80">
</div>
<div class="col-sm">
<img class="itemCard" src="https://images.unsplash.com/photo-1505429155379-441cc7a574f7?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=0ddea5332a8ab2d09cf5eec6a57d3f9f&auto=format&fit=crop&w=334&q=80">
</div>
<div class="col-sm">
<img class="itemCard" src="https://images.unsplash.com/photo-1505429155379-441cc7a574f7?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=0ddea5332a8ab2d09cf5eec6a57d3f9f&auto=format&fit=crop&w=334&q=80">
</div>
</div>
</div>
But this doesn't (./home.component.html):
<div class="container">
<p class="h2-responsive itemsTitle">Items with free shipping</p>
<hr>
<div class="row">
<app-home-item></app-home-item>
<app-home-item></app-home-item>
<app-home-item></app-home-item>
<app-home-item></app-home-item>
</div>
</div>
(./home-item.component.html):
<div class="col-sm">
<img class="itemCard" src="https://images.unsplash.com/photo-1505429155379-441cc7a574f7?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=0ddea5332a8ab2d09cf5eec6a57d3f9f&auto=format&fit=crop&w=334&q=80">
</div>
Here's what happens. The circled part shows that the images are slightly off to the left, which doesn't happen when I use the first example code above.
I am not too sure where it goes wrong. All the components are imported and declared in app.module. The bootstrap link is placed in the index.html as well.
CSS (in styles.css):
.itemsTitle {
margin-top: 16px;
}
.itemCard {
width: 15rem;
}
The problem is with the width of col inside app-home-item so in that component add flex: 1; to the wrapper
I'm having an image inside a div. Underneath it is a margim. I tried with firebug to look at the div code and img, but I did not find anything declared with magin and padding.
<div class="row">
<div class="col s4">
<img class="responsive-img" src="imagem/IMG_8380.jpg" alt=""/>
</div>
<div class="col s4">
<img class="responsive-img" src="imagem/IMG_8265.jpg" alt=""/> </div>
<div class="col s4">
<img class="responsive-img" src="imagem/IMG_8711.jpg" alt=""/>
</div>
</div>
Been there. Set img {display:block;}
<div class="container p0">
<div class="col-md-12 p0">
<div class="col-md-6 p0">
<div class="imagen"></div>
</div>
<div class="col-md-6 p0">
<div class="text-content"></div>
</div>
</div>
</div>
I do not have a definite css yet, I still think how I can do this
How can I make the image full width inside a container, just like in the example using bootstrap, The black border is the bootstrap container
What I try to do is the content in a container and the image outside of that container,
Just set these properties--
.imagen img{
width: 100%;
max-width: 100%;
}
Here you go with jsfiddle https://jsfiddle.net/9drawa3h/1/.
<div class="container p0">
<div class="col-md-12 p0">
<div class="col-md-6 p0">
<div class="imagen"></div>
</div>
<div class="col-md-6 p0">
<div class="text-content">
<img src="http://a57.foxnews.com/images.foxnews.com/content/fox-news/tech/2013/04/13/how-to-do-free-online-background-check/_jcr_content/par/featured-media/media-1.img.jpg/876/493/1422493303787.jpg?ve=1&tl=1" />
</div>
</div>
</div>
</div>
I know you are looking for text-content in the second column, but I specified something else.
As I not sure whether you are going to use img tag ro background-image in the 1st column, so I have provided both.
1st Column with background-image and 2nd column with img tag.
my image does not display as the true size, I've also tried to embed height and width but that does not work either. any idea of the proper code to get my .png to display as the original size?
my code is ----->
<div class="divPanel notop nobottom">
<div class="row-fluid">
<div class="span12">
<div id="divLogo" class="center">
<a href="index-alt.html" id="divSiteTitle">
<img src="images/logo.png" alt="Tech Mule" class="img-circle" title="Tech Mule"/>
</a>
</div>
</div>
</div>
</div>
I created a WP theme template that already has Bootstrap "installed" and ready to go. I use this for most of my projects and have never had a problem.
For some reason, this particular website isn't responding when I resize the browser screen.
View here: http://staging.ceobusinessalliance.com/about/
I'm trying to troubleshoot the issue but I can't find anything wrong. Here is the basics of the code:
<div class="row">
<div class="col-xs-1"></div>
<div class="col-xs-5"></div>
<div class="col-xs-5"></div>
<div class="col-xs-1"></div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-1"></div>
<div class="col-sm-5"></div>
<div class="col-sm-5"></div>
<div class="col-sm-1"></div>
</div>
<div class="row">
<div class="col-sm-12"></div>
</div>
<div class="row">
<div class="col-sm-12"></div>
</div>
<div class="row">
<div class="col-sm-1"></div>
<div class="col-sm-10"></div>
<div class="col-sm-1"></div>
</div>
</div>
Thanks in advance!
You are overwriting Bootstrap CSS with this line of code in your style.css file, which gives your website a fixed width of 1080px.
.container { width: 1080px !important; padding: 0; }
You need to remove width: 1080px !important;