• Item over grid row

    From Andrew Poulos@21:1/5 to All on Wed Jan 8 14:11:57 2020
    I have a 1 x 3 CSS grid (header, content, footer) and each of the items
    stretch to fill their allocated space. The elements within content may
    be wider than the allocate space, in which case a horizontal scrolling
    bar appears.

    So far so good.

    I now need to "float" a small div over row 2, and centred on it.

    Would the way to approach this be to create another row specifically for
    the small div (ie the grid is now 1 x 4) and to set the start and end
    rows of the other items appropriately?

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?8J+YiSBHb29kIEd1eSDwn5iJ?@21:1/5 to Andrew Poulos on Wed Jan 8 04:17:17 2020
    This is a multi-part message in MIME format.
    On 08/01/2020 03:11, Andrew Poulos wrote:

    I now need to "float" a small div over row 2, and centred on it.



    You don't need to float anything. Just use flex for it.

    .contentdiv{
    display: flex;
    flex-direction: row;
    justify-content: center;
    }


    Grid is good to create your layout (multi-dimensional); flex is good
    for single dimensional to position the items; There is nothing to stop
    you from using both at the same time, that's the beauty of grid and flex
    in css. Please post your code for us to see your actual layout so that
    an appropriate solution can be given.


    --
    With over 1.2 billion devices now running Windows 10, customer
    satisfaction is higher than any previous version of windows.

    <html>
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    </head>
    <body bgcolor="#FFFFE0" text="#006600">
    <div class="moz-cite-prefix">On 08/01/2020 03:11, Andrew Poulos
    wrote:<br>
    </div>
    <blockquote
    cite="mid:oKGdnftWus3j1YjDnZ2dnUU7-aPNnZ2d@westnet.com.au"
    type="cite"><br>
    I now need to "float" a small div over row 2, and centred on it.
    <br>
    <br>
    <br>
    </blockquote>
    <br>
    You don't need to float anything.  Just use flex for it.<br>
    <br>
    <blockquote type="cite">
    <div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #d4d4d4;"> </span>.content<span style="color: #
    d4d4d4;"> </span>div<span style="color: #d4d4d4;"> {</span></div><div><span style="color: #d4d4d4;">            </span><span style="color: #9cdcfe;">display</span><span style="color: #d4d4d4;">: flex;</span></div><div><span style="color: #
    d4d4d4;">            </span><span style="color: #9cdcfe;">flex-direction</span><span style="color: #d4d4d4;">: row;</span></div><div><span style="color: #d4d4d4;">            </span><span style="color: #9cdcfe;">justify-content</
    span><span style="color: #d4d4d4;">: center;</span></div><div><span style="color: #d4d4d4;">        }</span></div></div>
    </blockquote>
    <br>
    <br>
    Grid is good to create your layout (multi-dimensional);  flex is
    good for single dimensional to position the items;   There is
    nothing to stop you from using both at the same time, that's the
    beauty of grid and flex in css.   Please post your code for us to
    see your actual layout so that an appropriate solution can be given.<br>
    <br>
    <br>
    <div class="moz-signature">-- <br>
    <div class="moz-signature">
    <div style="width: 340px;height: 290px; background-color: blue;
    color: yellow;font-weight: bolder; font-size:200%; text-align:
    center; margin: 30px 5px 30px 5px;">With over 1.2 billion
    devices now running Windows 10, customer satisfaction is
    higher than any previous version of windows.</div>
    </div>
    </div>
    </body>
    </html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew Poulos@21:1/5 to All on Thu Jan 9 08:46:03 2020
    On 8/01/2020 3:17 pm, 😉 Good Guy 😉 wrote:
    On 08/01/2020 03:11, Andrew Poulos wrote:

    I now need to "float" a small div over row 2, and centred on it.



    You don't need to float anything.  Just use flex for it.

    .contentdiv{
    display: flex;
    flex-direction: row;
    justify-content: center;
            }


    Grid is good to create your layout (multi-dimensional);  flex is good
    for single dimensional to position the items;   There is nothing to stop you from using both at the same time, that's the beauty of grid and flex
    in css.   Please post your code for us to see your actual layout so that
    an appropriate solution can be given.

    Thanks. I tested a few things and what I needed was causing too many
    design issues so the page got redesigned to not need a small div over a
    grid row.

    Andrew Poulos

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)