Click here to Skip to main content
15,900,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I m beginner at about css, i dont understand why didnt div same line ? How can i do ?

[Linkk]

What I have tried:

<div id="stock-container">
                <div id="stock-leftside">
                    <div id="stock-leftside-top">
                         <div id="left-first-graph">11</div> 
                         <div id="left-middle-graph">222</div>
                         <div id="left-last-graph">333</div>
                    </div>         
                    <div id="stock-leftside-middle">
                        <div id="left-first-graph">444</div>
                        <div id="left-middle-graph">555</div>
                    </div>      
                    <div id="stock-leftside-bot">
                        <div id="left-first-graph">666</div>
                        <div id="left-middle-graph">777</div>
                    </div>       
                </div>
                <div id="stock-rightside">ccc</div>                 
            </div>
Posted
Updated 17-Aug-20 22:27pm
v2

Your code is pure HTML, CSS is the styling that is associated with particular elements of the HTML. Take a look at HTML div tag[^] for more information. Check especially the attributes that can be added as well as the CSS that can be used to modify colours etc.
 
Share this answer
 
Try the vertical-align: top CSS property.

Look at this jFiddle: Edit fiddle - JSFiddle - Code Playground[^]

By default, it is not set to top and thus what you see.
To play and see, remove '#boxContainer-right in css for vertical-align and you will get back what you see in your image.
 
Share this answer
 
v2
You have multiple elements with the same id. That's not allowed in HTML - each ID in the document must be unique.

There are several possible methods to achieve your layout. For example, you could use Flexbox:
CSS
#stock-container {
    display: flex;
}
#stock-leftside {
    flex-basis: 25%;
    display: flex;
    flex-direction: column;
}
#stock-rightside {
    flex-grow: 1;
}
#stock-leftside-middle {
    flex-grow: 1;
}
CSS Flexible Box Layout - CSS: Cascading Style Sheets | MDN[^]
A Complete Guide to Flexbox | CSS-Tricks[^]

Demo[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900