How to automatically adjust the height of an image to a grid area?











up vote
0
down vote

favorite












I'm quite new with grids, I'm a bit lost. I tried everything but I'm unable to make the height of the grid row to fit automatically to my image (embeded with css).



Here is my code :



HTML-------------------------------------------------------------------



<div class="wrapper-louez">
<div class="guirlande"></div>
</div>


CSS -----------------------------------------------------------------------



.wrapper-louez{
display: grid;
grid-template-columns: 1fr 50% 1fr;
grid-auto-rows: minmax(400px, auto);
}
.guirlande{
background: url(../img/louez-la-kantine-guirlande.png) no-repeat top center;
background-size: 100% auto;
grid-area: 1 / 1 / 1 / span 3;
}




I need the row to fit automatically to my image but the image doesn't show if I dont set a fixed row height in the wrapper. How can I make the height's row flexible ?



Thanks for your help.



Lucie










share|improve this question
























  • Would be helpful if you can post enough code to reproduce the problem.
    – Michael_B
    Nov 9 at 19:50















up vote
0
down vote

favorite












I'm quite new with grids, I'm a bit lost. I tried everything but I'm unable to make the height of the grid row to fit automatically to my image (embeded with css).



Here is my code :



HTML-------------------------------------------------------------------



<div class="wrapper-louez">
<div class="guirlande"></div>
</div>


CSS -----------------------------------------------------------------------



.wrapper-louez{
display: grid;
grid-template-columns: 1fr 50% 1fr;
grid-auto-rows: minmax(400px, auto);
}
.guirlande{
background: url(../img/louez-la-kantine-guirlande.png) no-repeat top center;
background-size: 100% auto;
grid-area: 1 / 1 / 1 / span 3;
}




I need the row to fit automatically to my image but the image doesn't show if I dont set a fixed row height in the wrapper. How can I make the height's row flexible ?



Thanks for your help.



Lucie










share|improve this question
























  • Would be helpful if you can post enough code to reproduce the problem.
    – Michael_B
    Nov 9 at 19:50













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm quite new with grids, I'm a bit lost. I tried everything but I'm unable to make the height of the grid row to fit automatically to my image (embeded with css).



Here is my code :



HTML-------------------------------------------------------------------



<div class="wrapper-louez">
<div class="guirlande"></div>
</div>


CSS -----------------------------------------------------------------------



.wrapper-louez{
display: grid;
grid-template-columns: 1fr 50% 1fr;
grid-auto-rows: minmax(400px, auto);
}
.guirlande{
background: url(../img/louez-la-kantine-guirlande.png) no-repeat top center;
background-size: 100% auto;
grid-area: 1 / 1 / 1 / span 3;
}




I need the row to fit automatically to my image but the image doesn't show if I dont set a fixed row height in the wrapper. How can I make the height's row flexible ?



Thanks for your help.



Lucie










share|improve this question















I'm quite new with grids, I'm a bit lost. I tried everything but I'm unable to make the height of the grid row to fit automatically to my image (embeded with css).



Here is my code :



HTML-------------------------------------------------------------------



<div class="wrapper-louez">
<div class="guirlande"></div>
</div>


CSS -----------------------------------------------------------------------



.wrapper-louez{
display: grid;
grid-template-columns: 1fr 50% 1fr;
grid-auto-rows: minmax(400px, auto);
}
.guirlande{
background: url(../img/louez-la-kantine-guirlande.png) no-repeat top center;
background-size: 100% auto;
grid-area: 1 / 1 / 1 / span 3;
}




I need the row to fit automatically to my image but the image doesn't show if I dont set a fixed row height in the wrapper. How can I make the height's row flexible ?



Thanks for your help.



Lucie







html css css3 grid css-grid






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 22:13









Michael_B

141k44225335




141k44225335










asked Nov 9 at 11:08









Lucie Arlette

1




1












  • Would be helpful if you can post enough code to reproduce the problem.
    – Michael_B
    Nov 9 at 19:50


















  • Would be helpful if you can post enough code to reproduce the problem.
    – Michael_B
    Nov 9 at 19:50
















Would be helpful if you can post enough code to reproduce the problem.
– Michael_B
Nov 9 at 19:50




Would be helpful if you can post enough code to reproduce the problem.
– Michael_B
Nov 9 at 19:50

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224579%2fhow-to-automatically-adjust-the-height-of-an-image-to-a-grid-area%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224579%2fhow-to-automatically-adjust-the-height-of-an-image-to-a-grid-area%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to pass form data using jquery Ajax to insert data in database?

National Museum of Racing and Hall of Fame

Guess what letter conforming each word