Hi,
Using a grid on a webpage but the text ALWAYS is centred - why?
.gridsidebarleft {
background-color: lavender;
display: grid;
grid-gap: 5px;
padding: 5px;
text-align: left;
grid-template-columns: 2fr 3fr;
grid-template-areas:
'a b';
}
.sideleft {
grid-area: a;
border-style: solid;
border-color: black;
}
.panel {
grid-area: b;
border-style: solid;
border-color: black;
}
<div class="gridsidebarleft">
<div class="sideleft">
<h3>The sidebar</h3>
<p>
Some meaningless text to see how this works.
It should be left-aligned, but might not be.
</p>
<p>
Some more just to make it visually better.
</p>
</div>
<div class="panel">
<h3>The main panel</h3>
</div>
</div>
How do I force the text to align correctly?
TIA,
Dermot
Using a grid on a webpage but the text ALWAYS is centred - why?
.gridsidebarleft {
background-color: lavender;
display: grid;
grid-gap: 5px;
padding: 5px;
text-align: left;
grid-template-columns: 2fr 3fr;
grid-template-areas:
'a b';
}
.sideleft {
grid-area: a;
border-style: solid;
border-color: black;
}
.panel {
grid-area: b;
border-style: solid;
border-color: black;
}
<div class="gridsidebarleft">
<div class="sideleft">
<h3>The sidebar</h3>
<p>
Some meaningless text to see how this works.
It should be left-aligned, but might not be.
</p>
<p>
Some more just to make it visually better.
</p>
</div>
<div class="panel">
<h3>The main panel</h3>
</div>
</div>
How do I force the text to align correctly?
TIA,
Dermot