0

I's a surprise for me - using an input as a grid element - without a div wrapper.

Is there any downside of this layout?

Is there any problem using textarea, ul, ol... etc, and not only divs, as a grid element?

Thanks.

.btop{
 display:grid;
 grid-template-columns:1fr auto;
}

.binptop{
height:25px;
}

.gallplus{
padding:0 14px;
text-align:center;
line-height:25px;
background:gold;
}
<div class='btop'>
<input type='text' class='bintop' id='binptop' maxlength = "54" autocomplete = 'off'>
<div class='gallplus' title='GALERIJA PLUS'>PLUS</div>
</div>
Paulie_D
  • 107,962
  • 13
  • 142
  • 161
qadenza
  • 9,025
  • 18
  • 73
  • 126
  • the only think you should consider is the default value applied to such element. otherwise, any element ca be a grid item (but not grid container btw) – Temani Afif Nov 24 '19 at 13:04
  • For clear limitations, look for elements the don't accept changes to their `display` value. See the duplicate for details. – Michael Benjamin Nov 24 '19 at 13:59
  • @Michael_B it's about using element as grid items, not grid container. He's calling them *grid element* instead of *grid item* – Temani Afif Nov 24 '19 at 14:01
  • @TemaniAfif, I'm not entirely sure that's correct, since we have no control over, as the question states, with your interpretation: *"what type of element is possible to use as a grid [item]?"*. We don't get to pick which element becomes a grid item. A grid item is always the in-flow child of a grid container, regardless of the element type. Hence, the only reasonable question becomes, which element can be a grid container. – Michael Benjamin Nov 24 '19 at 15:06
  • @Michael_B Maybe but checking his code, the input is a grid item and he's asking *Is there any downside of this layout?* and I guess he's talking about the code he shared. I know we cannot choose what element can be a grid item but we can choose to not make it a grid item if we wrap it inside a div that will become the grid item (that's why he said *using an input as a grid element - without a div wrapper.*) ... well, only the asker can tell us what he meant exactly. It's probably something completely different from what both are thinking. – Temani Afif Nov 24 '19 at 15:12

0 Answers0