-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project 9g - Divs not loading side by side #59
Comments
To display the profile previews side by side, you need to wrap them in a container and apply CSS to that container to make them display inline or inline-block. Here's how you can modify your code: HTML: CSS: .profile-container { white-space: nowrap; } With these modifications, the profile previews should appear side by side instead of stacked on top of each other. |
You need to close the dicv in the html fro what I see in your code the css is alright but I think maybe you didn't close the div in the html for the first code before pasting the second div |
the div in which you kept "name", "number of mutual friends", "Add friend button", change or mention the "display:inline-block" property in the three divs., as inline-block property would let the elements take as much space as they need to, thus, the three divs would come side by side. |
Even when I copy and paste the example html and css code, the divs all appear stacked on top of one another instead of side by side, any ideas why?
Mooncat
10 mutual friends
Add FriendAndy Frasco
18 mutual friends
Add FriendDerek Vincet Smith
4 mutual friends
Add Friend`p {
font-family: Arial;
margin-top: 0;
margin-bottom: 0;
}
.profile-preview {
width: 200px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
display: inline-block;
margin-right: 15px;
}
.profile-picture {
width: 200px;
height: 200px;
object-fit: cover;
margin-bottom: 12px;
}
.name {
font-size: 18px;
font-weight: bold;
margin-left: 8px;
margin-bottom: 4px;
}
.mutual-friends {
font-weight: 500;
color: rgb(100, 100, 100);
margin-left: 8px;
margin-bottom: 12px;
}
.add-friend-button {
background-color: rgb(24, 119, 242);
color: white;
font-size: 16px;
margin-left: 8px;
margin-bottom: 10px;
padding: 10px 20px;
border: none;
border-radius: 4px;
}
`
The text was updated successfully, but these errors were encountered: