How to create a speech bubble with css only - html

I want to make a speech bubble and I'm almost achieving my goal. Just a simple thing that is driving me crazy.
Check HERE to see my code and what I need.
I tried this:
HTML:
<div class="date">
03 Fev 14
</div>
CSS:
.date{
display: block;
width: 50px;
font-weight: 400;
background-color: #00a1e0;
color: #FFFFFF;
font-size: 11px;
text-transform: uppercase;
padding: 10px 15px;
position: relative;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
margin-bottom: 20px;
}
.date:after {
content: '';
position: absolute;
border-style: solid;
border-width: 10px 6px 0;
border-color: #00a1e0 transparent;
display: block;
width: 0;
z-index: 1;
bottom: -10px;
left: 0px;
}
As you can see, at the moment I have a triangle with two angles of 45degrees, and I want it to have an angle of 90degrees on top aligned to the left.
How can I achieve this without the use of an additional image?

You need to add the last value for border-width. Try this:
.date:after {
border-width: 10px 10px 0 0;
}
.date {
display: block;
width: 50px;
font-weight: 400;
background-color: #00a1e0;
color: #FFFFFF;
font-size: 11px;
text-transform: uppercase;
padding: 10px 15px;
position: relative;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
margin-bottom: 20px;
}
.date:after {
content: '';
position: absolute;
border-style: solid;
border-width: 10px 10px 0 0;
border-color: #00a1e0 transparent;
display: block;
width: 0;
z-index: 1;
top: 100%;
left: 0px;
}
<h3>What I want: (image)</h3>
<img src="http://i.imgur.com/wlyK9EN.png">
<br>
<br>
<h3>What I have:</h3>
<div class="date">
03 Fev 14
</div>

Related

How create a specific space between an element and it pseudo-element "::before" ? CSS

I would like to create this corner in the top-left of my title:
The problem is that I didn't find the way to decale the title from the corner.
Could you help me pls ?
This is my code:
<h2 class="title_project_details">{project.name}</h2>
.title_project_details{
margin-bottom: 15px;
font-family: Poppins-semi-bold;
font-size: 29px;
color: #210B41;
letter-spacing: 1px;
}
.title_project_details::before{
border-left: 3px solid #310C50;
border-top: 3px solid #310C50;
content: '';
display: inline-block;
height: 30px;
width: 30px;
}
.title_project_details{
margin-bottom: 15px;
font-family: Poppins-semi-bold;
font-size: 29px;
color: #210B41;
letter-spacing: 1px;
}
.title_project_details::before{
border-left: 3px solid #310C50;
border-top: 3px solid #310C50;
content: '';
display: inline-block;
height: 30px;
width: 30px;
}
<h2 class="title_project_details">{project.name}</h2>
My actual result:
Thanks in advance !
Try positioning the elements set relative for the title and set absolute for the ::before
.title_project_details{
margin-bottom: 15px;
font-family: Poppins-semi-bold;
font-size: 29px;
color: #210B41;
letter-spacing: 1px;
position: relative;
padding: 3px 18px
}
.title_project_details::before{
border-left: 2px solid #310C50;
border-top: 2px solid #310C50;
content: '';
display: inline-block;
height: 30px;
position: absolute;
top: 0;
left: 0;
width: 30px;
}
body {margin: 20px;}
<h2 class="title_project_details">project.name</h2>
Add padding if you want space (I saw space in the reference image you showed there)
I tried to use absolute positioning for ::before, for me it looks like your desired result. u might tweak with top and left properties.
.title_project_details{
margin-bottom: 15px;
position:relative;
font-family: Poppins-semi-bold;
font-size: 29px;
color: #210B41;
letter-spacing: 1px;
}
.title_project_details::before{
border-left: 3px solid #310C50;
border-top: 3px solid #310C50;
position: absolute;
left: -6px;
top: -1px;
content: '';
display: inline-block;
height: 30px;
width: 30px;
}
<h2 class="title_project_details">{project.name}</h2>

How can I left align and right align my chat bubbles?

I have created two chat bubbles which one of them I need to be left aligned and other one I need to be right aligned .As of now my css grow both till the end like below image .
As of now I do not want to hardcode the width and want the bubble to grow with chat text and both one should be left aligned and other one should be right aligned like below:
CSS:
.speech-wrapper{
padding: 5px 6px;
}
.chatbox {
padding: 5px;
margin-left: 5px;
margin-right: 5px;
margin-top:0px;
background: #075698;
color: #FFF;
position: relative;
border-radius: 10px;
overflow-wrap: break-word;
word-wrap: break-word;
hyphens: auto;
box-shadow: 0 8px 6px -6px black;
}
.chatbox_other{
height:auto;
padding: 5px;
margin-left: 5px;
margin-right: 5px;
margin-top:0px;
background: #DCDCDC;
color: #000;
position: relative;
border-radius: 10px;
overflow-wrap: break-word;
word-wrap: break-word;
hyphens: auto;
box-shadow: 0 8px 6px -6px black;
}
.name_other{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #1970b0;
}
.name_other1{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #ba006e;
}
.name_other2{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #007670;
}
.name_other3{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #3b0256;
}
.name_other4{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #00512b;
}
.name_other5{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #a91024;
}
.name_other6{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #b8471b;
}
.name_other7{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #7f1c7d;
}
.timestamp_other{
font-size: 11px;
position: absolute;
bottom: 0px;
right: 10px;
text-transform: uppercase; color: #999
}
.timestamp{
font-size: 11px;
position: absolute;
bottom: 0px;
right: 10px;
text-transform: uppercase; color: #fff
}
/* speech bubble 13 */
.name{
font-weight: 600;
font-size: 12px;
margin: 0px 0px 9px;
color: #ffffff;
}
.triangle.left-top:after {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: -10px;
right: auto;
top: 0px;
bottom: auto;
border: 22px solid;
border-color: #DCDCDC transparent transparent transparent;
z-index: -1;
}
.triangle.right-top:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
left: auto;
right: -10px;
top: 0;
bottom: auto;
border: 32px solid;
border-color: #075698 transparent transparent
transparent;
z-index: -1;
}
.alt{
margin: 0 0 0 60px;
}
HTML:
<div class="speech-wrapper">
<div class="chatbox triangle right-top alt">
<div class="txt">
<p class="name">Apple TestUser1</p>Hi<span class="timestamp">10:20 pm</span></div>
</div>
<div class="speech-wrapper">
<div class="chatbox_other triangle left-top">
<div class="txt">
<p class="name">Apple TestUser1</p>Hi<span class="timestamp">10:20 pm</span>
</div>
</div>
</div>
</div>
I have tried uisng float left but while reducing the windows size the chat started overlapping on eachother
For testing out try below link
https://codepen.io/rajesh-kumar-dash/pen/KbvqQX
I think using float: right; for the right bubble and for the left bubble: float: left; with width: auto; should work
The "dirty" way to do it is by adding a after the divs just to clear the float:
<div class="speech-wrapper"><div class="chatbox triangle right-top alt"><div class="txt"><p class="name">Apple TestUser1</p>Hi<span class="timestamp">10:20 pm</span></div></div>
<div style="clear:both"></div>
<div class="speech-wrapper"><div class="chatbox_other triangle left-top"><div class="txt"><p class="name">Apple TestUser1</p>Hi<span class="timestamp">10:20 pm</span></div></div>
<div style="clear:both"></div>
The cleaner way to do it is called "Clearfix". I suggest you take a look on these two links to understand it and use on your code:
https://www.w3schools.com/css/css_float.asp
https://css-tricks.com/snippets/css/clear-fix/
If you want the size of your box as large as the text in it, you have to set "display: inline-block";
To make sure your box wont get bigger then a certain size use "max-width".
With "overflow-wrap: break-word" your text breaks if it reaches the max-width.

Html5 Border-Radius Reverse Fill

I want to achieve drop-down button as per following design image. See drop-down menu starts just after middle of button. My problem is that button has transparent background to utilize background image from root parent div.
So far I have achieved following image. As I said above, I want to achieve white edges outside of border-radius.
.dropdown-header {
border-top-left-radius: 20px;
border-top-right-radius: 20px;
width: 210px;
height: 185px;
margin: auto;
}
.div-user-header {
width: 210px;
margin: auto;
position: relative;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
}
.div-user-header-1 {
width: 206px;
height: 24px;
border: 2px solid #9CB2C7;
border-radius: 20px;
display: inline-block;
text-align: center;
padding-top: 5px;
}
.div-user-header-1 a {
text-decoration: none;
color: #FCCC00;
display: block;
}
.div-user-header-list {
position: absolute;
background-color: white;
height: 170px;
width: 210px;
}
.div-user-header-2 a {
text-decoration: none;
font-size: 12px;
color: #8C8C8C;
}
.div-user-header-2 {
height: 40px;
padding: 12px 15px;
}
.div-user-header-3 a {
text-decoration: none;
font-size: 12px;
color: #8C8C8C;
}
.div-user-header-3 {
height: 40px;
padding: 12px 15px;
}
.div-add-profile-card {
padding: 0px 15px;
}
.div-add-profile-card a {
text-decoration: none;
color: #8C8C8C;
font-size: 10px;
padding: 12px;
display: block;
border-top: 1px solid #D6D6D6;
}
<div class="dropdown-header">
<div class="div-user-header">
<div class="div-user-header-1">
ProfileUser 01
</div>
<div class="div-user-header-list">
<div class="div-user-header-2">
<img src="../../../assets/images/avtar2.png" width="34px" height="34px" style="padding-right: 5px; vertical-align: middle" />
ProfileUser 01
</div>
<div class="div-user-header-3">
<img src="../../../assets/images/user-02.png" width="30px" height="30px" style="padding-right:5px; vertical-align: middle" />
ProfileUser 02
</div>
<div class="div-add-profile-card">
+ Add Profile Cards
</div>
</div>
</div>
Any suggestion would be really helpful.
Use ::after ::before pseudo elements for the dropdown and apply separate background-image as marked in the image. Apply position:absolute and align then in the top left and right corners based on the design.
It's very simple. You have achieved almost 99%. Just add below styles to your CSS of .div-user-header-list as below:
.div-user-header-list {
position: absolute;
background-color: white;
height: 170px;
width: 210px;
padding-top: 20px;
margin-top: -20px;
z-index: -1;
}
See the updated fiddle here: https://jsfiddle.net/8ukj3wy1/1/
Check this one out:
https://jsfiddle.net/sLy7fnzg/
Essentially use a negative margin to move the .div-user-header-list up and use relative positioning to enable z-indexes.
Also, to resolve the issue with the half border, remove the border from the .div-user-header-1 and add a whole element as a ::before to the .div-user-header like so:
.div-user-header::before {
content: "";
background: #9CB2C7;
width: 210px;
height: 30px;
display:block;
position: absolute;
top: 0;
left: 0;
border-radius: 20px;
z-index: 1;
}
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<style>
body{
background-color: grey;
}
.dropdown-header {
border-top-left-radius: 20px;
border-top-right-radius: 20px;
width: 210px;
height: 203px;
margin: auto;
overflow: hidden;
/*background-color: #fff;*/
}
.div-user-header-list:before,
.div-user-header-list:after {
content: "";
position: absolute;
height: 10px;
width: 20px;
bottom: 0;
}
.div-user-header-list:before {
/*right: -20px;*/
left: 1px;
top: -10px;
border-radius: 0 0 0 10px;
-moz-border-radius: 0 0 0 10px;
-webkit-border-radius: 0 0 0 10px;
-webkit-box-shadow: -10px 0 0 0 #fff;
box-shadow: -10px 0 0 0 #fff;
}
.div-user-header-list:after {
/*left: -20px;*/
right: 1px;
top: -10px;
border-radius: 0 0 10px 0;
-moz-border-radius: 0 0 10px 0;
-webkit-border-radius: 0 0 10px 0;
-webkit-box-shadow: 10px 0 0 0 #fff;
box-shadow: 10px 0 0 0 #fff;
}
.div-user-header {
width: 210px;
margin: auto;
position: relative;
border-radius: 20px;
}
.div-user-header-1 {
width: 206px;
height: 24px;
border: 2px solid #9CB2C7;
border-radius: 20px;
display: inline-block;
text-align: center;
padding-top: 5px;
}
.div-user-header-1 a {
text-decoration: none;
color: #FCCC00;
display: block;
}
.div-user-header-list {
position: absolute;
background-color: white;
height: 170px;
width: 210px;
/*margin-top: -14px;
z-index: -9;
padding-top: 14px;*/
}
.div-user-header-2 a {
text-decoration: none;
font-size: 12px;
color: #8C8C8C;
}
.div-user-header-2 {
height: 40px;
padding: 12px 15px;
}
.div-user-header-3 a {
text-decoration: none;
font-size: 12px;
color: #8C8C8C;
}
.div-user-header-3 {
height: 40px;
padding: 12px 15px;
}
.div-add-profile-card {
padding: 0px 15px;
}
.div-add-profile-card a {
text-decoration: none;
color: #8C8C8C;
font-size: 10px;
padding: 12px;
display: block;
border-top: 1px solid #D6D6D6;
}
</style>
</head>
<body>
<div class="dropdown-header">
<div class="div-user-header">
<div class="div-user-header-1">
ProfileUser 01
</div>
<div class="div-user-header-list">
<div class="div-user-header-2">
<img src="../../../assets/images/avtar2.png" width="34px" height="34px" style="padding-right: 5px; vertical-align: middle" />
ProfileUser 01
</div>
<div class="div-user-header-3">
<img src="../../../assets/images/user-02.png" width="30px" height="30px" style="padding-right:5px; vertical-align: middle" />
ProfileUser 02
</div>
<div class="div-add-profile-card">
+ Add Profile Cards
</div>
</div>
</div>
</body>
</html>

HTML/CSS: Display image in semicircle in top of modal box

I have a requirement of displaying the image/icon on top of the modal box in a semicircle. Though I have achieved it with the help of below code, but the only issue is whenever my form in the modal box goes for a validation check, displaying any error, my semicircle doesn't get adjusted accordingly, rather it stays at its position. Here, I have attached the screen shot of what exactly I am looking for and HTML/css code I have used to display the semicircle with image/icon at the top.
.modal {
font-family: Avenir-Medium;
font-size: 16px;
font-weight: 900;
font-style: normal;
font-stretch: normal;
display: block;
/*Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.3);
/* Black w/ opacity */
-webkit-animation-name: slideIn;
/* Fade in the background */
-webkit-animation-duration: 2.0s;
/* Fade in the background */
;
}
/* Modal Content */
.modal-content {
position: fixed;
bottom: 0;
background-color: #fefefe;
width: 92%;
left: 14px;
-webkit-animation-name: fadeIn;
-webkit-animation-duration: 0.5s;
border-radius: 16px 16px 0px 0px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border: none;
top: auto;
}
.modal-wrapper {
line-height: 45px;
border: 1px solid #e7e9ea;
border-radius: 6px 6px 0px 0px;
background-color: white;
margin: auto;
}
.modal-wrapper::after {
background: url("../../../../images/mobile/img-payment_38.png") no-repeat 22px 10px;
background-size: 50%;
background-color: #fff;
content: '';
width: 78px;
height: 45px;
position: absolute;
left: 0;
right: 0;
margin: auto;
border-radius: 78px 78px 0 0;
border-left: 1px solid #e7e9ea;
border-top: 1px solid #e7e9ea;
border-right: 1px solid #e7e9ea;
border-bottom: 3px solid white;
bottom: 300px;
}
.close-btn {
position: absolute;
vertical-align: top;
top: 4px;
left: 320px;
width: 18px;
height: 18px;
}
.container-div-creditCard {
margin: 12px 20px 0px 20px;
}
.container-div-creditCard>img {
position: absolute;
bottom: 154px;
right: 30px;
}
.credit-card-modal-label {
font-family: AvenirHeavy;
font-size: 13px;
color: #1d3444;
text-align: center;
font-weight: 200;
height: 24px;
margin-left: 31px;
}
.input-modal {
width: 100%;
height: 44px;
}
.input-spacing {
margin-top: 15px;
}
.credit-input-modal {
border: solid 1px #e7e9ea;
border-radius: 5px;
font-family: Avenir-Book;
font-size: 14px;
font-weight: normal;
color: #8589a1;
line-height: initial;
padding: 13px 42px 12px 15px;
}
.credit-expiry-input-modal {
padding: 13px 27px 12px 10px;
border: solid 1px #e7e9ea;
border-radius: 5px;
font-family: Avenir-Book;
font-size: 14px;
font-weight: normal;
color: #8589a1;
display: inline-block;
line-height: initial;
width: 65%;
height: 44px;
}
.credit-cvc-input-modal {
width: 30%;
padding: 17px 5px 12px 10px;
border: solid 1px #e7e9ea;
border-radius: 5px;
font-family: Avenir-Book;
font-size: 14px;
font-weight: normal;
color: #8589a1;
line-height: initial;
height: 44px;
}
.cvvDisc {
-webkit-text-security: disc;
}
.credit-submit-button {
width: 100%;
padding: 13px;
margin-top: 15px;
border: solid 1px #e7e9ea;
border-radius: 5px 5px 5px 5px;
background: linear-gradient(to right, #e32490, #ed1a3d);
color: white;
margin-bottom: 20px;
font-family: Avenir-Book;
font-weight: normal;
font-size: 14px;
line-height: initial;
}
.errorMsg {
font-family: Avenir-Book;
font-weight: normal;
color: #ED1A3D;
font-size: 12px;
}
<div id="modalCCDetails" class="modal">
<div class="modal-content modal-wrapper">
<div class="container-div-creditCard">
<label class="credit-card-modal-label">ENTER YOUR CREDIT CARD DETAILS</label>
<input name="cc_name" class="input-modal credit-input-modal" type="text" placeholder="Name printed on Credit Card" onChange={this.handleUserInput} />
<span class="errorMsg"></span>
<input name="cc_number" class="input-modal credit-input-modal input-spacing" type="tel" maxLength="16" onKeyPress={(e)=> this.handleCCOnKeyPress(e)} placeholder="16 digit credit card number" />
<span class="errorMsg"></span>
<input name="cc_expDate" class="credit-expiry-input-modal" type="text" placeholder="Expiry MM-YYYY" />
<div class="device-divider" />
<input name="cc_cvc" class="credit-cvc-input-modal cvvDisc" type="tel" placeholder="CVC" maxLength="3" />
<span class="errorMsg"></span>
</div>
<button class="credit-submit-button">Submit Payment</button>
</div>
</div>
</div>
NOTE: This is a mobile view screenshot
Just adjust your css code into something like this:
.modal-wrapper::after {
background: url("../../../../images/mobile/img-payment_38.png") no-repeat 22px 10px;
background-size: 50%;
background-color: #fff;
content: '';
width: 78px;
height: 45px;
position: absolute;
left: 0;
right: 0;
margin: auto;
border-radius: 78px 78px 0 0;
border: 1px solid #e7e9ea;
border-bottom: 3px`enter code here` solid white;
top: -48px;
}
Just remove the bottom: 300px; and replace with top: -48px; or any value that you want.
please add top:-15px; and removed bottom:300px; in class .modal-wrapper::after { top: -15px; }, u will see the image move up

Why is there extra space at the top of my div?

BEFORE YOU SAY THIS IS A DUPLICATE
I have tried the margin-top: 0px;
<html>
<head>
<style>
html, body {
padding: 0px;
margin: 0px;
}
body {
font: 22px trebuchet ms;
}
button {
color: white;
font: 18px verdana;
background-color: #aef731;
border-style: solid;
border-bottom-color: #96d626;
border-width: 0px;
border-bottom-width: 7px;
border-radius: 12px;
padding: 5px;
}
button:active {
border-bottom-width: 0px;
position: relative;
top: 7px;
}
button:focus {
outline: none;
}
div.title {
padding-left: 15px;
color: white;
background-color: #96d626;
}
cat.indent {
padding-left: 30px;
}
img.slgm {
border-style: solid;
border-color: #000000;
border-width: 4px;
float: left;
position: relative;
top: 30px;
left: 30px;
}
div.txt1 {
border-style: solid;
border-color: #000000;
border-width: 4px;
background-color: #e8e8e8;
float: right;
position: relative;
top: 30px;
right: 30px;
padding: 5px;
width: 600px;
}
div.txt2 {
border-style: solid;
border-color: #000000;
border-width: 4px;
background-color: #e8e8e8;
width: 400px;
position: relative;
top: 200px;
left: 30px;
padding: 5px;
}
</style>
</head>
<body>
<div class="title"><h1>60 Second Science!</h1><cat class="indent">Molecules of Solids, Liquids and Gases</cat></div>
<img src="SLGM.png" class="slgm">
<div class="txt1"><h3>Introduction</h3>Solids, liquids and gases all have different molecular structures. Today, we will explore each form of matter's molecules.<br><h3>Solids</h3>Solids(left) have a very compact structure. The molecules squish together and barely vibrate.<br><h3>Liquids</h3>Molecules in liquids(center) can move freely but stay bond together causing them to have a definite volume, but not a definite shape.</div>
<div class="txt2"><h3>Gases</h3>Gases(right) have no definite shape or volume. This is because their molecular structure is very spacious. The particles have broke free of each other. Therefore, the gas can expand.</div>
</body>
</html>
So when I run this code, the div with the class "txt2" has a bunch of space at the top. Could someone please help? I have also tried removing padding at the top, rewriting the code, etc. I need this done very soon so any response helps!
:D
The problem is that your div.txt2 has the rule top: 200px, which would explain the extra height. I've changed this to top: 30px to match the height of your other <div> in my example.
Also note that many of your elements have a fixed width of several hundred pixels. This won't scale on mobile devices, and you should consider using percentage-based values instead.
<html>
<head>
<style>
html,
body {
padding: 0px;
margin: 0px;
}
body {
font: 22px trebuchet ms;
}
button {
color: white;
font: 18px verdana;
background-color: #aef731;
border-style: solid;
border-bottom-color: #96d626;
border-width: 0px;
border-bottom-width: 7px;
border-radius: 12px;
padding: 5px;
}
button:active {
border-bottom-width: 0px;
position: relative;
top: 7px;
}
button:focus {
outline: none;
}
div.title {
padding-left: 15px;
color: white;
background-color: #96d626;
}
cat.indent {
padding-left: 30px;
}
img.slgm {
border-style: solid;
border-color: #000000;
border-width: 4px;
float: left;
position: relative;
top: 30px;
left: 30px;
}
div.txt1 {
border-style: solid;
border-color: #000000;
border-width: 4px;
background-color: #e8e8e8;
float: right;
position: relative;
top: 30px;
right: 30px;
padding: 5px;
width: 600px;
}
div.txt2 {
border-style: solid;
border-color: #000000;
border-width: 4px;
background-color: #e8e8e8;
width: 400px;
position: relative;
/*top: 200px;*/
top: 30px;
left: 30px;
padding: 5px;
}
</style>
</head>
<body>
<div class="title">
<h1>60 Second Science!</h1>
<cat class="indent">Molecules of Solids, Liquids and Gases</cat>
</div>
<img src="SLGM.png" class="slgm">
<div class="txt1">
<h3>Introduction</h3>Solids, liquids and gases all have different molecular structures. Today, we will explore each form of matter's molecules.<br>
<h3>Solids</h3>Solids(left) have a very compact structure. The molecules squish together and barely vibrate.<br>
<h3>Liquids</h3>Molecules in liquids(center) can move freely but stay bond together causing them to have a definite volume, but not a definite shape.</div>
<div class="txt2">
<h3>Gases</h3>Gases(right) have no definite shape or volume. This is because their molecular structure is very spacious. The particles have broke free of each other. Therefore, the gas can expand.</div>
</body>
</html>