I'm using the React-Carbon library to design a new part of a frontend for a client, and I'm having problems with the positioning of a modal. As you can see in the image below, clicking on the button in the table opens the modal (and makes the 'darkening' div visible), but the position of the modal isn't relative to where the viewer is currently looking. As a result, it looks as if the modal hasn't opened until you scroll up.
The CSS for the modal is as follows:
.bx--modal {
align-items: center;
box-sizing: border-box;
display: flex;
height: 920px;
justify-content: center;
left: 0px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
position: fixed;
top: 0px;
visibility: hidden;
width: 1680px;
z-index: 9000;
}
EDIT, the HTML is as follows:
<div role="dialog" class="bx--modal-container" aria-label="Edit requisition" aria-modal="true" tabindex="-1"><div class="bx--modal-header"><h3 id="bx--modal-header__heading--modal-125" class="bx--modal-header__heading">Settings</h3><button class="bx--modal-close" type="button" title="Close" aria-label="Close"><svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-label="Close" width="20" height="20" viewBox="0 0 32 32" role="img" class="bx--modal-close__icon"><path d="M24 9.4L22.6 8 16 14.6 9.4 8 8 9.4 14.6 16 8 22.6 9.4 24 16 17.4 22.6 24 24 22.6 17.4 16 24 9.4z"></path></svg></button></div><div id="bx--modal-body--modal-125" class="bx--modal-content" aria-labelledby="bx--modal-header__heading--modal-125"><svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" class="bx--select__arrow"><path d="M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"></path></svg></div></div></div></div></div><div class="bx--modal-footer bx--btn-set"><button tabindex="0" class="bx--btn bx--btn--secondary" type="button">Cancel</button><button tabindex="0" class="bx--btn bx--btn--primary" type="button">Save</button></div></div>
If you render the modal into a separate div using React.createPortal (https://reactjs.org/docs/portals.html), you should be able to use the default Carbon modal CSS.
Here is an example codepen: jGBWpE.
H/T to user cbr who suggested this debugging step.
Related
I have a <div id="Frame"> element, within it is a <svg> element. I would like the <svg> element to be centered in the frame, and grow at a aspect ratio of 1/1, until one edge uses up say 90% of the available space (so it almost fills the whole space, but has a bit of a border).
But I can't get the SVG to grow. I read the many other similar SO answers, some say CSS overrides the width/height attributes of the SVG, but I tried removing them just incase (not ideal), but it still did not grow). The other common soluation is width: 100%; height: auto;, which did not work for me.
main {
padding: 0; margin: 0;
width: 100vw;
height: 100vh;
}
#FRAME {
padding: 0; margin: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
background-color: lightyellow;
position:relative;
}
#FRAME svg {
max-width: 90%;
max-height: 90%;
width: 90%;
height: auto;
aspect-ratio: 1/1;
flex-grow: 1;
}
<main>
<div id="FRAME">
<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24">
<path d="M0 0h24v24H0z" fill="none"></path>
<path d="M3 5v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5a2 2 0 0 0-2 2zm12 4c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3zm-9 8c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1H6v-1z"></path>
</svg>
</div>
</main>
You'll need to add a viewBox to the SVG to determine the SVG viewport.
Whilst the width and height attributes help with keeping the aspect ratio, viewBox helps with scaling the SVG contents correctly.
<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"></path>
<path d="M3 5v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5a2 2 0 0 0-2 2zm12 4c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3zm-9 8c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1H6v-1z"></path>
</svg>
I ran into a weird problem with Safari.
It seems to ignore the padding of a link when the span inside is inline-block.
Works in FF and Chrome but Safari just ignores the right padding.
I can add a padding to the span inside but then FF and Chrome have too much space on the right. The structure is generated by the speeddial component in primefaces so not easily changed.
Here's a Screenshot of the problem in Safari and Firefox for comparison.
Anyone ran into this problem before?
Thanks in advance!
ul{
width: 200px;
height: auto;
list-style: none;
}
li{
margin-bottom: 1em;
}
a{
display: inline-block;
background: red;
padding: 0 1em;
}
span{
white-space: nowrap;
}
svg{
margin-right: 0.5em;
max-width: 1.25rem;
vertical-align: bottom;
}
<ul>
<li>
<a href="#"><span>
<svg enable-background="new 0 0 20 21.4" viewBox="0 0 20 21.4">
<path d="m13.1 8.4v-6h1v-2h-8.2v2h1v6l-4.4 9.6c-.1.1-.1.3-.1.4v.5c0 .2 0 .4.1.6s.1.4.3.5c.2.3.4.5.7.7.2.2.5.3.9.3h11.2c.3 0 .7-.1 1-.3s.5-.4.7-.7c.2-.3.3-.6.3-1 0-.3 0-.7-.2-1zm-4.2.7c0-.1.1-.2.1-.2 0-.1 0-.1 0-.2v-6.2h2v6.2.2c0 .1 0 .2.1.2l2.1 4.7h-6.4z" fill="#fff"></path>
</svg>
Link text one
</span></a>
</li>
<li>
<a href="#"><span>
<svg enable-background="new 0 0 20 21.4" viewBox="0 0 20 21.4">
<path d="m13.1 8.4v-6h1v-2h-8.2v2h1v6l-4.4 9.6c-.1.1-.1.3-.1.4v.5c0 .2 0 .4.1.6s.1.4.3.5c.2.3.4.5.7.7.2.2.5.3.9.3h11.2c.3 0 .7-.1 1-.3s.5-.4.7-.7c.2-.3.3-.6.3-1 0-.3 0-.7-.2-1zm-4.2.7c0-.1.1-.2.1-.2 0-.1 0-.1 0-.2v-6.2h2v6.2.2c0 .1 0 .2.1.2l2.1 4.7h-6.4z" fill="#fff"></path>
</svg>
Link text
</span></a>
</li>
</ul>
I want the height of the picture to always be equal to the height of the text, I'm assuming that the height of the div depends on the height of the content and I'm trying to set this height in the picture by specifying height: 100%; but it doesn't work - how can i fix the problem
<!DOCTYPE html>
<body>
<div class="container">
<svg xmlns=" http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="#2329D6" stroke-width="1" color="#2329D6">
<path
d="M16 12C15.3333333 12.6666667 15 14 15 16L15 17 9 17 9 16C9 14 8.66666667 12.6666667 8 12 5.6739597 9.6739597 5.41421356 6.10050506 7.75735931 3.75735931 10.1005051 1.41421356 13.8994949 1.41421356 16.2426407 3.75735931 18.5857864 6.10050506 18.4068484 9.59315157 16 12zM10 21L14 21" />
</svg>
<div class="text">
<div class="text__first">First</div>
<div class="text__second">second</div>
</div>
</div>
</body>
<style>
.container {
display: flex;
flex-direction: row;
font-size: 20vmin;
}
.text {
background: green;
}
.text__first {
font-size: 20vmin;
}
.text__second {
font-size: 10vmin;
}
svg {
height: 100%;
}
</style>
</html>
Add some simple wrapper and make it a grid. I added a border for visual clarity and based the font on the original container by using em.
.container {
display: flex;
flex-direction: row;
font-size: 20vmin;
}
.image-container {
display: grid;
}
.text {
background: green;
}
.text__first {
1em;
/* based on container */
}
.text__second {
font-size: 0.5em;
}
.container .image-container svg {
border: 1px solid #FFAAFF;
height: 100%;
}
<div class="container">
<div class="image-container">
<svg xmlns=" http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="#2329D6" stroke-width="1" color="#2329D6">
<path
d="M16 12C15.3333333 12.6666667 15 14 15 16L15 17 9 17 9 16C9 14 8.66666667 12.6666667 8 12 5.6739597 9.6739597 5.41421356 6.10050506 7.75735931 3.75735931 10.1005051 1.41421356 13.8994949 1.41421356 16.2426407 3.75735931 18.5857864 6.10050506 18.4068484 9.59315157 16 12zM10 21L14 21" />
</svg>
</div>
<div class="text">
<div class="text__first">First</div>
<div class="text__second">second</div>
</div>
</div>
I'm trying to space out the 'categories' along the black bar and put divider spacers in-between. The 'categories' are in a list. I was able to put them horizontally but am having trouble spacing them out. How would I go about doing this ? For visuals I mocked up the desired result in illustrator below.
Here is what I have so far:
HTML:
<div class="ride-stats">
<div class="ride-stats-content">
<ul>
<li>
<div class="ride-stats-col ride-stats-distance">
<span class="icon-distance">
<svg height= 10mm width= 12mm xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36.75 35.86">
<g id="prefix__Layer_2" data-name="Layer 2">
<g id="prefix__Layer_1-2" data-name="Layer 1">
<path class="prefix__cls-1"
d="M3.33 30a2.5 2.5 0 012.49-2.49h6.74a5.83 5.83 0 000-11.65h-.84v3.33h.84a2.5 2.5 0 010 5H5.82a5.82 5.82 0 000 11.64H25v-3.29H5.82A2.5 2.5 0 013.33 30zM6.73 0A6.73 6.73 0 000 6.73c0 5 6.73 12.5 6.73 12.5s6.73-7.45 6.73-12.5A6.73 6.73 0 006.73 0zm0 9.13a2.4 2.4 0 112.4-2.4 2.39 2.39 0 01-2.4 2.4zM30 16.64a6.73 6.73 0 00-6.73 6.73c0 5 6.73 12.49 6A6.72 6.72 0 0030 16.64zm0 9.13a2.41 2.41 0 112.4-2.4 2.41 2.41 0 01-2.4 2.4z" />
</g>
</g>
</svg>
</span>
<span class="ride-stats-label">Distance:</span>
<span> <h3>19.5</h3> <span>km</span></span>
</div>
</li>
<li>
<div class="ride-stats-col ride-stats-elevation">
<span class="icon-elevation">
<svg height= 10mm width= 12mm xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36.75 18.51">
<g data-name="Layer 2">
<path d="M36.75 18.52H0l6.32-9.26L12.63 0l6.32 9.26 1.53 2.24.19-.26 5.36-7.27 10.72 14.55z"
data-name="Layer 1" />
</g>
</svg>
</span>
<span class="ride-stats-label">Elevation:</span>
<span> <h3>120</h3>
<span>m</span>
</span>
</div>
</li>
<li>
<div class="ride-stats-col ride-stats-difficulty">
<span class="icon-difficulty">
<svg height=10mm width= 12mm xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36.75 35.87">
<g id="prefix__Layer_2" data-name="Layer 2">
<g id="prefix__Layer_1-2" data-name="Layer 1">
<path class="prefix__cls-1"
d="M27.83 0h8.92v35.86h-8.92zM0 23.91h8.92v11.95H0zM13.92 11.97h8.92v23.9h-8.92z" />
</g>
</g>
</svg>
</span>
<span class="ride-stats-label">Difficulty:</span>
<span> <h3>Easy</h3></span>
</div>
</li>
</ul>
</div>
</div>
CSS:
.ride-stats {
color: white;
margin: 0;
position: relative;
}
.ride-stats svg{
fill: red;
}
.ride-stats h3 {
font-family: sans-serif;
display: inline-block;
font-size: 25px;
font-weight: 700;
margin-bottom: 0;
}
.ride-stats-content {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
margin: 0 auto 0 auto;
max-width: 1100px;
background: #282828;
padding: 20px 0 20px 0;
}
ul li{
display: inline-flex;
text-align: center;
margin: 0 0 0px 0;
}
* {
box-sizing: border-box;
}
ul li .ride-stats-col{
text-decoration: none;
display: flexbox;
}
.ride-stats-col {
position: relative;
text-align: center;
flex-grow: 1;
flex-basis: 0; padding: 15px 0;
}
.ride-stats .icon-distance, .ride-stats .icon-elevation, .ride-stats .icon-difficulty{
display: block;
min-height: 55px;
}
Your issue is that you are setting the display:flex in the incorrect class, you have to apply to the ul instead
Snippet - with a bit of CSS improved
* {
box-sizing: border-box;
margin: 0
}
.ride-stats {
color: white;
}
.ride-stats svg {
fill: red;
}
.ride-stats h3 {
font-family: sans-serif;
display: inline-block;
font-size: 25px;
font-weight: 700;
}
.ride-stats-content {
margin: 0 auto;
max-width: 1100px;
background: #282828;
}
.ride-stats-content ul {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
padding: 20px;
list-style: none;
}
[class^='icon-'] {
display: block;
min-height: 55px;
}
.ride-stats-label {
display: block
}
<div class="ride-stats">
<div class="ride-stats-content">
<ul>
<li>
<div class="ride-stats-col ride-stats-distance">
<span class="icon-distance">
<svg height= 10mm width= 12mm xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36.75 35.86">
<g id="prefix__Layer_2" data-name="Layer 2">
<g id="prefix__Layer_1-2" data-name="Layer 1">
<path class="prefix__cls-1"
d="M3.33 30a2.5 2.5 0 012.49-2.49h6.74a5.83 5.83 0 000-11.65h-.84v3.33h.84a2.5 2.5 0 010 5H5.82a5.82 5.82 0 000 11.64H25v-3.29H5.82A2.5 2.5 0 013.33 30zM6.73 0A6.73 6.73 0 000 6.73c0 5 6.73 12.5 6.73 12.5s6.73-7.45 6.73-12.5A6.73 6.73 0 006.73 0zm0 9.13a2.4 2.4 0 112.4-2.4 2.39 2.39 0 01-2.4 2.4zM30 16.64a6.73 6.73 0 00-6.73 6.73c0 5 6.73 12.49 6A6.72 6.72 0 0030 16.64zm0 9.13a2.41 2.41 0 112.4-2.4 2.41 2.41 0 01-2.4 2.4z" />
</g>
</g>
</svg>
</span>
<span class="ride-stats-label">Distance:</span>
<span> <h3>19.5</h3> <span>km</span></span>
</div>
</li>
<li>
<div class="ride-stats-col ride-stats-elevation">
<span class="icon-elevation">
<svg height= 10mm width= 12mm xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36.75 18.51">
<g data-name="Layer 2">
<path d="M36.75 18.52H0l6.32-9.26L12.63 0l6.32 9.26 1.53 2.24.19-.26 5.36-7.27 10.72 14.55z"
data-name="Layer 1" />
</g>
</svg>
</span>
<span class="ride-stats-label">Elevation:</span>
<span> <h3>120</h3>
<span>m</span>
</span>
</div>
</li>
<li>
<div class="ride-stats-col ride-stats-difficulty">
<span class="icon-difficulty">
<svg height=10mm width= 12mm xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36.75 35.87">
<g id="prefix__Layer_2" data-name="Layer 2">
<g id="prefix__Layer_1-2" data-name="Layer 1">
<path class="prefix__cls-1"
d="M27.83 0h8.92v35.86h-8.92zM0 23.91h8.92v11.95H0zM13.92 11.97h8.92v23.9h-8.92z" />
</g>
</g>
</svg>
</span>
<span class="ride-stats-label">Difficulty:</span>
<span> <h3>Easy</h3></span>
</div>
</li>
</ul>
</div>
</div>
I'm creating a div where users can leave a review about a class. At the end of the reviews, there is going to be text: "Show More" that loads more reviews. However, there is this white space between the very last review and the "Show More" text. How do I get rid of this?
/* font */
#import url(https://fonts.googleapis.com/css?family=Open+Sans);
/* end of font */
/* clear settings */
body {
padding: 0;
margin: 0;
background: white;
}
/* end of clear settings */
/* courses.php */
#star_score {
font-size: 20px;
color: #777;
position: relative;
top: -50px;
left: 265px;
}
.Rating2, .Rating3 {
position: relative;
width: 125px;
height: 25px;
top: -41px;
left: 180px;
}
.Rating2 {
top: -24px;
left: 130px;
}
.Rating3 {
width: 75px;
height: 15px;
position: absolute;
top: 70px;
left: -88px;
}
.Rating2 svg, .Rating3 svg {
position: absolute;
z-index: 1;
top: 0;
right: 0;
bottom: 0;
left: 0;
top: 0;
}
.Rating2 meter, .Rating3 meter {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
position: absolute;
z-index: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #B6C2CC;
}
.Rating2 meter::-moz-meter-bar, .Rating3 meter::-moz-meter-bar {
background: #FF7867;
}
.Rating2 meter::-webkit-meter-optimum-value, .Rating2 meter::-webkit-meter-suboptimum-value, .Rating2 meter::-webkit-meter-even-less-good-value, .Rating3 meter::-webkit-meter-optimum-value, .Rating3 meter::-webkit-meter-suboptimum-value, .Rating3 meter::-webkit-meter-even-less-good-value {
background: #FF7867;
}
/* Reviews */
#course_reviews {
border: 1px solid #DDD;
background: white;
width: 579px;
padding: 15px;
font-family: 'Open Sans', sans-serif;
position: relative;
left: 50px;
top: -20px
}
#review_text {
font-size: 18px;
font-weight: bold;
}
#course_line2 {
width: 610px;
height: 1px;
background: #ddd;
position: relative;
top: -38px;
left: -15px;
}
#student_rating {
position: relative;
left: -15px;
width: 610px;
margin-bottom: 10px;
}
#student_rating_img {
width: 60px;
height: 60px;
border-radius: 50%;
position: relative;
top: -20px;
left: 20px;
}
#student_username {
color: #00698C;
position: relative;
top: -88px;
left: 100px;
width: 490px;
}
#student_date {
font-size: 14px;
color: #999;
}
#student_content {
color: #0E0E0F;
width: 490px;
position: relative;
top: 5px;
}
#show_more {
padding: 10px;
border-top: 1px solid #ddd;
position: relative;
left: -15px;
width: 590px;
cursor: pointer;
}
#show_more:hover {
text-decoration: underline;
}
#show_more_text {
position: relative;
top: 8px;
left: 10px;
}
/* End of Reviews */
/* end of courses.php */
<?php
require "connect.php";
?>
<!DOCTYPE html>
<html>
<head>
<title> Hacked Genius </title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
<link rel='stylesheet' href='main.css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<script src='main.js'></script>
</head>
<body id='course_body'>
<br> <br> <br>
<!-- Reviews -->
<!-- Top Part -->
<div id='course_reviews'>
<span id='review_text'> 2937 Reviews </span>
<div class="Rating2">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 100">
<defs>
<path id="a" d="M0 0h500v100H0V0zm50 79L20.6 94.5l5.6-32.8L2.4 38.5l33-4.7L50 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L50 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L150 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L150 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L250 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L250 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L350 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L350 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L450 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L450 79z"/>
</defs>
<use fill="white" fill-rule="evenodd" xlink:href="#a"/>
</svg>
<meter min="0" max="5" value="4.28"></meter>
</div> <span id='star_score'> 4.7 </span>
<div id='course_line2'></div>
<!-- End of Top Part -->
<!-- Student Part -->
<div id='student_rating'>
<img src='https://cdnil1.fiverrcdn.com/photos/31519238/small/1459227_10151771032542219_1796077253_n.jpg?1461604087' id='student_rating_img'>
<!-- Student Usernames -->
<div id='student_username'> Matthew Malan <span id='student_date'> 1 day ago </span> <br>
<span id='student_content'> Outstanding Experience! </span>
<!-- Student Rating -->
<div class="Rating3">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 100">
<defs>
<path id="a" d="M0 0h500v100H0V0zm50 79L20.6 94.5l5.6-32.8L2.4 38.5l33-4.7L50 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L50 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L150 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L150 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L250 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L250 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L350 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L350 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L450 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L450 79z"/>
</defs>
<use fill="white" fill-rule="evenodd" xlink:href="#a"/>
</svg>
<meter min="0" max="5" value="4"></meter>
</div>
<!-- End of Student Rating -->
</div>
<!-- End of Student Usernames & Stars -->
</div>
<!-- End of Student Part -->
<!-- Student Part -->
<div id='student_rating'>
<img src='https://cdnil1.fiverrcdn.com/photos/31519238/small/1459227_10151771032542219_1796077253_n.jpg?1461604087' id='student_rating_img'>
<!-- Student Usernames -->
<div id='student_username'> Matthew Malan <span id='student_date'> 1 day ago </span> <br>
<span id='student_content'> Outstanding Experience! </span>
<!-- Student Rating -->
<div class="Rating3">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 100">
<defs>
<path id="a" d="M0 0h500v100H0V0zm50 79L20.6 94.5l5.6-32.8L2.4 38.5l33-4.7L50 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L50 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L150 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L150 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L250 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L250 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L350 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L350 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L450 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L450 79z"/>
</defs>
<use fill="white" fill-rule="evenodd" xlink:href="#a"/>
</svg>
<meter min="0" max="5" value="4"></meter>
</div>
<!-- End of Student Rating -->
</div>
<!-- End of Student Usernames & Stars -->
</div>
<!-- End of Student Part -->
<!-- Student Part -->
<div id='student_rating'>
<img src='https://cdnil1.fiverrcdn.com/photos/31519238/small/1459227_10151771032542219_1796077253_n.jpg?1461604087' id='student_rating_img'>
<!-- Student Usernames -->
<div id='student_username'> Matthew Malan <span id='student_date'> 1 day ago </span> <br>
<span id='student_content'> Outstanding Experience! </span>
<!-- Student Rating -->
<div class="Rating3">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 100">
<defs>
<path id="a" d="M0 0h500v100H0V0zm50 79L20.6 94.5l5.6-32.8L2.4 38.5l33-4.7L50 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L50 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L150 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L150 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L250 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L250 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L350 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L350 79zm100 0l-29.4 15.5 5.6-32.8-23.8-23.2 33-4.7L450 4l14.7 29.8 33 4.7-24 23.2 5.7 32.8L450 79z"/>
</defs>
<use fill="white" fill-rule="evenodd" xlink:href="#a"/>
</svg>
<meter min="0" max="5" value="4"></meter>
</div>
<!-- End of Student Rating -->
</div>
<!-- End of Student Usernames & Stars -->
</div>
<!-- End of Student Part -->
<!-- Show More -->
<div id='show_more'> <span id='show_more_text'> Show More </span> </div>
<!-- End of Show More -->
</div>
<!-- End of Reviews -->
Before I start, I notice that all your student-rating divs have the same ID value. Please note that this is invalid HTML as you shouldn't have multiple elements on a page with the same ID. You should use class="student-rating" instead of id=. For the rest of this answer I'll assume that you've done this. Note that my code below will only work if you do this.
The main problem you have is caused by you positioning all the elements within the review div with a negative top.
Although you've got them all positioned well relative to each other, the actual student-rating div ends up with a big gap at the bottom that can't easily be closed up.
You also have an extra gap caused by margin-bottom:10px, which makes the white space even bigger.
There is a quick and dirty way to solve this, There is also a more difficult solution that will end up with your code being better overall.
First, the quick solution:
Firstly, move the 'Show more' element outside of the course-reviews element, so that the code below affects the last review, and not the show more button. Then, add the following code:
.student-rating:last-of-type {
margin-botton:-15px;
}
This will override the bottom margin on the last review, and should close up the gap nicely. Feel free to adjust the exact value if you need to, but -15px looks about right to me.
This solution is quite 'hacky'; it's not good code, but it works with what you've got. The better solution, below, would be to fix your existing code so that a hack like this isn't necessary.
How do you do that? Well, it's too long to justify putting in an answer here, but in short, you need to get rid of all those negative top values you've got in the CSS for the elements within student-rating. Start with the biggest one and set it to zero, then adjustall the others by the same amount. The layout should remain the same visually for the rating block, but it should make it easier to get it positioned properly. I notice you've also got some negative left values too. Those should probably be removed as well while you're at it.
My guess is that you've added the negative top and left values in order to compensate for other layout glitches, so those will probably need to be resolved as well once you've done that. But this time without using negative positioning!