#cannot space divs

1 messages · Page 1 of 1 (latest)

somber tartan
#
  float:right;
  margin: auto;
  padding:25px;
  align-items: center;
  width:100%;
  display:flex
}
.mid-container {
  display:flex;
  flex-direction: row;
  justify-content:center;
  width:100%;
  margin: 25px 0;
}```
#
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.9em;
    font-family: sans-serif;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
}```
#

why cant I get my news to be in the middle of the space between the end of the table and the end of the page? it is just sticking next ot the table

#

Float right doesnt work

#

im an idiot

#

ignore!

#

closing post my html had a type in a name

molten plaza
#

Play around with the display property. It probably needs to be set to block.

You can also try a clearfix solution. I think that's a clear property. Give it a search.

somber tartan
#

newswrapper was spelt newsrapper

#

with 3 p

molten plaza
#

The float is causing the divs to appear in a row. You need to break that. The above techniques should do it.

somber tartan
#

what a bout if i had a container with elements going in a row, but i want my first element on the left and the second element in the cente rof the page?

#

margin auto wont work for that

molten plaza
#

Why not?

somber tartan
#

let me show you

molten plaza
#

So I don't think you should be mixing floats with flex.

somber tartan
#

Ah ok

#

whats the recommended way?

#

flex + margin?

#

also how do you deal with going from a 24inch 1080p screen to also looking the same on a 4k 14inch laptop?

molten plaza
#

One or the other.

Though admittedly my CSS game is weak. I use frameworks for these layout problems.

#

Floats and auto margin can manage this. Or flex alone

somber tartan
#

im using auto margin but they wont seperate with one being in center of the parent container

molten plaza
#

Responsiveness is a hard problem. Look at Foundation, Bootstrap, or Tailwind.

molten plaza
#

But I could be wrong.