Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS divs are not in the same height column wise

sabsac

Coder
Please check attached html and css files.The 3 divs are not arranged at the same height from top.what is changes required in my csss to bring the 3 column/divs at the same height?
 

Attachments

Last edited:
If HTML does not look the way you expected, I recommend running it through a validator such as https://validator.w3.org/
This at once reveals that you are not closing all your <div> tags. Having fixed that, the 3 div's are now neatly lined vertically which is a bit of progress. Now, on to the CSS.

There is also a CSS validator at https://jigsaw.w3.org/css-validator/ but this reports no errors in your CSS. Which rather surprises me because on line 153 there is a spurious start comment tag, /* Apparently this is being simply ignored, but I'd take it out for good measure.

Now why are they underneath each other rather than next to each other ? Your basic error is that you put the display:flex inside the divs. It needs to go into a container around these divs. Try this
CSS:
.cont
{
    display: flex;
}

.row
{
    margin-top: 5%;
    justify-content: space-between;
}

with

HTML:
<div class="cont">
...
</div>

around your 3 divs (and make sure you terminate all 3 of them !)

Not sure what the justify-content: space-between; is supposed to achieve, I don't see it making a difference. If you want some space between the 3 divs, add for example margin:10px to the .row class.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom