gpt-3.5-turbo-0613· openai
Suzhen/CodeChat
html css code for "divide the section portion into two parts vertically and add content"
- User
html css code for "divide the section portion into two parts vertically and add content"
- Assistant
Here is an example of HTML and CSS code to divide a section portion into two parts vertically and add content:
HTML code:
<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="styles.css"> </head> <body> <div class="container"> <div class="column"> <h2>Left Column</h2> <p>This is the left column content.</p> </div> <div class="column"> <h2>Right Column</h2> <p>This is the right column content.</p> </div> </div> </body> </html>CSS code (styles.css file):
.container { display: flex; } .column { flex-basis: 50%; padding: 20px; border: 1px solid #ccc; }In this example, we use the 'container' class as a wrapper with the 'display: flex' property to create a flex container. The 'column' class represents the individual columns within the container. We set 'flex-basis: 50%' to make each column take up 50% of the container's width. The 'padding' property adds spacing around the content, and the 'border' property adds a border around each column.