Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. 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.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

HTML & CSS Struggle with column and placement of text

Mateusz

New Coder
I am very new to coding, currrently i am struggling with alignment of some elements in my div.
Here is the stuff i am trying to code (made in adobe XD) This is what it must look like brad pitt 1.jpg

This is what i currently made in css plus html: download (1).png
HTML:
HTML:
<div class="row">
        <div class="column">
            <div class="timesiden">
                <div>1 time siden</div>
            </div>
            <p>Hej alle. Jeg søger en multimediedesigner til mit Kommende projekt, håber i vil hjælpe. Jeg har br..</p>
        </div>

    </div>
CSS:
Code:
                                                                                        .column {
                                                                                        float: row;
                                                                                        width: 30%;
                                                                                        height: 150px;
                                                                                        margin: auto;
                                                                                        padding: 50px;
                                                                                        background-color: #E3F1F0;
                                                                                        border-radius: 15px;
                                                                                    }
                                                                                    /* Clear floats after the columns */
                                                                                   
                                                                                    .row:after {
                                                                                        content: "";
                                                                                        display: table;
                                                                                        clear: both;
                                                                                    }
                                                                                   
                                                                                    .timesiden {
                                                                                        vertical-align: text-top;
                                                                                    }
I am struggling a lot with the placement of the class "timesiden" that i made in on the of divs. I cant do anything to make it go to the top right corner .
My other question is how can i allign "like icon" and "comment icon" as viewed in Adobe XD.
Hope its understandable.
I hope i have posted it the right way by the rules, if not then i apologize.
 

Attachments

  • download.png
    download.png
    86.8 KB · Views: 0
I managed to create this
Opret post.jpg
HTML:
<div class="row">
        <div class="column">
            <div class="timesiden">
                <div>1 time siden</div>
                <div class="profile">
                    <i class="fa fa-user" aria-hidden="true"></i>
                </div>
            </div>
            <p>Hej alle. Jeg søger en multimediedesigner til mit Kommende projekt, håber i vil hjælpe. Jeg har br........................ Se Mere</p>

            <div><a class="like"><i class="fa fa-thumbs-up"></i>
<div class="comment">
    <div><i class="fa fa-comments"></i>
    </div>
</div>
</div>
</div>
</div>

But when i try to copy paste the code, so i will have 2nd column, it doesnt appear the same as the first one, and i have no idea why.
This is what happens after copy paste the code:
after copy paste.jpg
Sorry for the big images 🙁
I have no idea why the copy pasted one doesnt look the same as the 1nd.
 
I dont think i have added second column, i just thought if i make one column with those icons, i could copy paste it 3 times and i will have three.
But its possibly not working like that..

I tried to copy paste the first column in HTML, with the same css for the first column.

CSS:
.column {
    float: row;
    margin: auto;
    width: 30%;
    height: 180px;
    padding: 50px;
    background-color: #E3F1F0;
    border-radius: 15px;
}


/* Clear floats after the columns */

.row:after {
    content: "";
    display: inline-block;
    clear: both;
}

.timesiden {
    text-align: right;
    margin-top: -40px;
    margin-bottom: 20px;
}

.like {
    margin: -40px;
    font-size: 35px;
    color: #548288;
    cursor: pointer;
}

.comment {
    text-align: right;
    margin: -40px;
    font-size: 35px;
}

.profile {
    font-size: 40px;
    text-align: left;
    cursor: pointer;
    margin-block-start: -20;
    color: #548288;
}

I know its a mess.. But i havent learn how to organize code yet. I just started coding.
i had tons of problems trying to allign those 3 icons as well, i know they shouldnt be alligned like that, but it kinda works.
I think i messed up some divs as well

.profile - is for profile icon
.comment - is for comment icon
.like - is for like icon
.timesiden - is for the text on the right top corner it means " one hour ago"
The idea with this, is that it has to look like somebody who "posted" something.

But they are somehow linked together, when i change lets say size of like icon the size of command icon changes too. I might have created too many classes in wrong divs, but i have no idea. Have been sitting few hours now trying to fix it, hehe .
 
Last edited:

Latest posts

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom