Hello! Could someone please assist me in understanding something.
Iām currently in the breadcrumbs styles lesson in the Front-End Engineer Career Path.
The lesson is teaching how to style breadcrumbs by using CSS styles to hide and manipulate parts of the background to create a arrow-like background behind the breadcrumbs⦠My confusion is why does the CSS make the transparent parts triangles?
I edited the code from the lesson for my own understanding so the transparent parts are now visible. Iām just confused why they show up as triangles and if they could be changed to other shapes.
Here is the CSS:
.breadcrumb {
text-align: left;
}
.breadcrumb li {
float: left;
}
.breadcrumb a {
color: #fff;
background: darkcyan;
text-decoration: none;
position: relative;
height: 30px;
line-height: 30px;
text-align: center;
margin-right: 15px;
padding: 0 5px;
}
.breadcrumb a::before,
.breadcrumb a::after {
content: āā;
position: absolute;
border-color: darkcyan;
border-style: solid;
border-width: 15px 5px;
}
.breadcrumb a::before {
left: -10px;
border-left-color: orange;
}
.breadcrumb a::after {
left: 100%;
border-color: transparent;
border-left-color: green;
}
.breadcrumb a:hover {
background-color: blue;
}
.breadcrumb a:hover::before {
border-color: blue;
border-left-color: cyan;
}
.breadcrumb a:hover::after {
border-left-color: blue;
}
and the HTML from the lesson:
<title>Hotels In Singapore</title>
<link href="https://fonts.googleapis.com/css?family=Catamaran:100|Pontano+Sans|Ruda:900" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="./style.css">
<link rel="stylesheet" type="text/css" href="./breadcrumb.css">
Hotels In Singapore
<div class="hotel-description">
<ul>
<li>
<h2>Raffles Hotel</h2>
</li>
<li>
<h3>$500/night</h3>
</li>
<li>
<p>Raffles Hotel is a colonial-style luxury hotel in Singapore. It was established by Armenian hoteliers, the Sarkies
Brothers, in 1887. The hotel was named after British statesman Sir Thomas Stamford Raffles, the founder of
Singapore. It is the flagship property of Raffles Hotels & Resorts, a subsidiary of Fairmont Raffles Hotels
International.</p>
</li>
</ul>
</div>
<div class="book">
<a href="#">Book Now</a>
</div>
</div>
<div class="hotel">
<div class="hotel-img">
<img src="https://content.codecademy.com/courses/ui-breadcrumbs/conradintl.jpg" width="250px">
</div>
<div class="hotel-description">
<ul>
<li>
<h2>Conrad Centennial Singapore</h2>
</li>
<li>
<h3>$400/night</h3>
</li>
<li>
<p>Located in the Downtown Core (near Millenia Tower), Marina Centre, Singapore. The hotel has 507 guestrooms including
25 suites, and 31 floors with two basements. The hotel's carpark is shared with Millenia Walk. Conrad Centennial
shares the same laundry services with sister hotel, The Ritz-Carlton Millenia Singapore. Both hotels are owned
by the same owner, Pontiac Land (owned by the Kwee brothers).</p>
</li>
</ul>
</div>
<div class="book">
<a href="#">Book Now</a>
</div>
</div>
<div class="hotel">
<div class="hotel-img">
<img src="https://content.codecademy.com/courses/ui-breadcrumbs/damenlou.jpg" width="250px">
</div>
<div class="hotel-description">
<ul>
<li>
<h2>Damenlou Hotel</h2>
</li>
<li>
<h3>$300/night</h3>
</li>
<li>
<p>Damenlou Hotel is a small hotel located at Ann Siang Road, in Chinatown, within the Central Area of Singapore.Damenlou
Hotel's origins can be traced to the creation of the dish of fishhead mifen (rice vermicelli), which was invented
by Tang Kwong Swee in the 1920s. The hotel had a famous restaurant, named Swee Kee.</p>
</li>
</ul>
</div>
<div class="book">
<a href="#">Book Now</a>
</div>
</div>
<div class="hotel">
<div class="hotel-img">
<img src="https://content.codecademy.com/courses/ui-breadcrumbs/shangrila.jpg" width="250px">
</div>
<div class="hotel-description">
<ul>
<li>
<h2>Shangri-La Hotel Singapore</h2>
</li>
<li>
<h3>$200/night</h3>
</li>
<li>
<p>The hotel has 747 guestrooms and suites spread over the Tower Wing, Garden Wing and Valley Wing, 127 serviced
apartments and 55 luxurious condominium units. The hotel boasts 15 acres of landscaped gardens which are visible
through the glass walls enclosing the lobby and dining areas, and has been referred to as "Singapore's other
botanical garden".</p>
</li>
</ul>
</div>
<div class="book">
<a href="#">Book Now</a>
</div>
</div>
<div class="hotel">
<div class="hotel-img">
<img src="https://content.codecademy.com/courses/ui-breadcrumbs/swissotel.jpg" width="250px">
</div>
<div class="hotel-description">
<ul>
<li>
<h2>Swissotel The Stamford</h2>
</li>
<li>
<h3>$100/night</h3>
</li>
<li>
<p>Designed by architect I.M. Pei, at a height of 226 meters it is one of Southeast Asia's tallest hotels. Situated
at 2 Stamford Road, the hotel sits above City Hall MRT Station. The 5-star hotel has 1,261 rooms and suites,
16 restaurants and bars, Raffles City Convention Centre, and one of Asia's largest spas.</p>
</li>
</ul>
</div>
<div class="book">
<a href="#">Book Now</a>
</div>
</div>
Any help would be greatly appreciated. Iām very confused on this.