Keeping SVG icons side-by-side in the nav bar - html

My problem is when I'm going to level the icons side by side, even though I put the margin and padding I've already turned many sites, in an attempt to solve it I created this bar where the buttons are aligned as well as implemented an animation on top of them, but if I put the icons together in front of this bar, it loses the animation's integrity.
My goal is to join the icons in the upper right corner...... besides twitter/tumblr I still have 3 others...
I appreciate any and all help, I'm a beginner in programming.
/*icones tumblr, insta*/
.icones i {
display: inline-block;
width: 100%;
height: 30px;
padding: 0px 20px;
margin: 0px 5px;
}
ul {
position: absolute;
top:20%;
left: 45%;
transform: translate(-80%, -70%);
margin: 0%;
padding: 20px 0px;
background: rgb(228, 211, 228);
display: flex;
border-radius: 15px;
}
ul li a{
list-style: none;
text-align: center;
display: block;
}
#tumblr {
width: 25px;
padding-left: 700px;
}
#twitter {
width: 45px;
padding-left: 600px;
margin-top: 10px;
margin-bottom: 2em;
}
.container {
display: grid;
grid-template-columns: 4fr 2fr;
grid-template-rows: 100px 50px;
grid-template-columns: auto auto auto auto auto auto;
}
#navbar {
display: flex;
flex-direction: column;
align-items: center;
grid-column: 1 / 5;
}
<nav class="container" style="background-color:#7B68EE; height:60px; width: 100%; text-align: center; border: 3px solid">
<div class="navbar">
<div id="nave">
<p style="text-align:right; color:rgb(248, 233, 185)">
<ul>
<li> Folders</li>
<li> Files</li>
<li> Content</li>
<li> Home</li>
<li> Documents </li>
<li></li>
</ul>
<div class="navbar2">
<a href="#" class="hrv-icon-bounce">
<div id="tumblr">
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="tumblr"
class="svg-inline--fa fa-tumblr fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
<path fill="currentColor" d="M309.8 480.3c-13.6 14.5-50 31.7-97.4 31.7-120.8 0-147-88.8-147-140.6v-144H17.9c-5.5
0-10-4.5-10-10v-68c0-7.2 4.5-13.6 11.3-16 62-21.8 81.5-76 84.3-117.1.8-11 6.5-16.3 16.1-16.3h70.9c5.5 0 10 4.5
10 10v115.2h83c5.5 0 10 4.4 10 9.9v81.7c0 5.5-4.5 10-10 10h-83.4V360c0 34.2 23.7 53.6 68 35.8 4.8-1.9 9-3.2 12.7-2.2
3.5.9 5.8 3.4 7.4 7.9l22 64.3c1.8 5 3.3 10.6-.4 14.5z"></path></svg>
</div>
</a>
<a href="#" class="hrv-icon-bounce">
<div id="twitter">
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="twitter" class="svg-inline--fa fa-twitter fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299
49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969
7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828
46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 0.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg>
</div>
</a>
</p>
</div>
</div>
</div>
</nav>

I've tidied and simplified your code and added some CSS styling to make it display how I think you probably want it. I've assumed you want the text menu centred and the social icons pushed to the right. I've added comments to the CSS so hopefully you can follow what I have done.
I've made the two parts of the nav bar into separate unordered lists (ul).
I am using a flex-box layout to position and size those two sections.
I set the text menu to be flex: 1 so it expands to fill most of the space in the nav bar. This pushes the social icons to the right hand end of the bar.
One final piece of advice to you as you begin programming:
Get into the habit of being consistent with your indenting. Keeping your code tidy will help you as you develop your program or website. And it will help anyone else who may need to work on it later.
nav.navbar {
/* Use a flex-box layout to put the menu and icons side by side */
display: flex;
/* Centre the flex children (the ULs) vertically in the flex box */
align-items: center;
background-color:#7B68EE;
height:60px;
width: 100%;
text-align: center;
border: 3px solid;
}
nav.navbar .menu {
/* Removes standard list styling. Hide bullets, remove padding. */
list-style: none;
padding: 0;
/* Make menu expand to fill most of the space in the menubar */
flex: 1;
}
nav.navbar .menu li {
/* Makes menu list items display horizontally rather than vertically */
display: inline;
}
/* Add some spacing between the menu items */
nav.navbar .menu li:not(:first-child) {
padding-left: 1em;
}
nav.navbar .social-icons {
/* Removes standard list styling. Hide bullets, remove padding. */
list-style: none;
padding: 0;
}
nav.navbar .social-icons li {
/* Makes social list items display horizontally rather than vertically */
display: inline;
}
nav.navbar .social-icons svg {
width: 30px;
height: 30px;
}
<nav class="navbar">
<ul class="menu">
<li>Folders</li>
<li>Files</li>
<li>Content</li>
<li>Home</li>
<li>Documents</li>
</ul>
<ul class ="social-icons">
<li>
<a href="#" class="hrv-icon-bounce">
<svg class="tumblr" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="tumblr"role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
<path fill="currentColor" d="M309.8 480.3c-13.6 14.5-50 31.7-97.4 31.7-120.8 0-147-88.8-147-140.6v-144H17.9c-5.5
0-10-4.5-10-10v-68c0-7.2 4.5-13.6 11.3-16 62-21.8 81.5-76 84.3-117.1.8-11 6.5-16.3 16.1-16.3h70.9c5.5 0 10 4.5
10 10v115.2h83c5.5 0 10 4.4 10 9.9v81.7c0 5.5-4.5 10-10 10h-83.4V360c0 34.2 23.7 53.6 68 35.8 4.8-1.9 9-3.2 12.7-2.2
3.5.9 5.8 3.4 7.4 7.9l22 64.3c1.8 5 3.3 10.6-.4 14.5z"></path>
</svg>
</a>
</li>
<li>
<a href="#" class="hrv-icon-bounce">
<svg class="twitter" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="twitter" role="img"viewBox="0 0 512 512">
<path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299
49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969
7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828
46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 0.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path>
</svg>
</a>
</li>
</ul>
</nav>

Related

Why are inline elements inside anchor tags not filling height of anchor, when anchor is flex item?

Consider the below code:
.container {
display: flex;
background: red;
align-items: center;
}
.inner {
background: blue;
}
<div class="container">
<a>
<span class="inner">Test<span>
</a>
</div>
The span is not filling the height of the anchor (you see the red below the bottom edge of the blue box).
Why is CSS behaving that way and how can it be fixed?
EDIT
The question above stems from the following code, which does not have a span but suffers from the same problem (i.e. the inside of the anchor element does not fill the height of the anchor):
.container {
display: flex;
flex-direction: row;
background: red;
}
svg {
height: 1em;
}
<div class="container">
<a>
Test
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" class="svg-inline--fa fa-arrow-right fa-1px " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" style="display: inline-block;"><path fill="currentColor" d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg>
</a>
</div>
This is what it looks like in Chrome DevTools, when inspecting the text inside the anchor element (the red box):
This is caused by the difference between the rendered height of the text - top of the ascent to the bottom of the descent - which depends on the font metrics, and the line height, which does not.
Because the default line height is almost the same as text height for a typical font, the difference is small, but still noticeable. We can see much better what's going on if we give the <a> element a larger line-height value.
.container {
display: flex;
background: red;
align-items: center;
}
.inner, svg {
background: blue;
}
a {
line-height: 3;
background: green;
}
svg {
height: 1em;
}
<div class="container">
<a>
<span class="inner">Test</span>
</a>
</div>
<hr>
<div class="container">
<a>
Test
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" class="svg-inline--fa fa-arrow-right fa-1px " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" style="display: inline-block;">
<path fill="currentColor" d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path>
</svg>
</a>
</div>
Block containers that establish an inline formatting context, like the <a> element when the .container div is display:flex, or the span when it's assigned display:inline-block, take the sum of line heights of the lines they contain as their height, rather than the height of the rendered text as the inline elements and text sequences do.
You can experiment with the line-height value of the <a> element to see if you can get a value that works well for your font, but there's currently no way in CSS for the line-height to be derived from the font metrics. There is a draft CSS specification that may allow it in the future.
.container {
display: flex;
flex-direction: row;
background: red;
}
a {
display: flex;
align-items: center;
flex: 1;
}
svg {
height: 1em;
}
<div class="container">
<a>
Test
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" class="svg-inline--fa fa-arrow-right fa-1px " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" style="display: inline-block;"><path fill="currentColor" d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg>
</a>
</div>
.container {
display: flex;
background: red;
align-items: center;
}
a {
display: flex;
flex: 1;
}
.inner {
flex: 1;
background: blue;
}
<div class="container">
<a>
<span class="inner">Test<span>
</a>
</div>
you need to tell the a-tag that it should grow. flex-direction: row is by the way the default.
.container {
display: flex;
background: red;
}
a { flex-grow: 1; }
svg {
height: 1em;
}
<div class="container">
<a>
Test
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" class="svg-inline--fa fa-arrow-right fa-1px " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" style="display: inline-block;"><path fill="currentColor" d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"></path></svg>
</a>
</div>

LI's with variable pixel/% widths not followed in full width of container

I'm working with the following code which creates a series of boxes as <UL><LI> tags. The splits are separate <LI>s with a background img containing the arrows. What needs to happen is that if you resize, the arrow-LI size must not change, but the data-LI size should accommodate and shrink accordingly. To accomplish this, the arrow-LI widths are specified in px, and the data-LI in %. At all times, the entire box bar must be 1-line.
This should work, but I see that if I resize, the last box is brought out to a 2nd line, and at some point later the next-to-last box will be lowered to a 2nd line too. The text does shrink, but it should auto-shrink even more to satisfy any reasonable browser width, while the arrow LIs are fixed.
Some text e.g. "Reference Letter Deadline" did shrink, but not enough to keep everything on 1 line.
Code:
<ul class="arrowDateBoxes dateLists">
<li class="arrowDateBox1">
<div class="arrowDateBoxContent">Application Cycle Opens</div>
</li>
<li class="arrowDateBox1Arrow">
</li>
<li class="arrowDateBox2">
<div class="arrowDateBoxContent">Application Deadline</div>
</li>
<li class="arrowDateBox2Arrow">
</li>
<li class="arrowDateBox1">
<div class="arrowDateBoxContent">Reference Letter Deadline</div>
</li>
<li class="arrowDateBox1Arrow">
</li>
<li class="arrowDateBox2">
<div class="arrowDateBoxContent">Selections for Program Interviews</div>
</li>
<li class="arrowDateBox2Arrow">
</li>
<li class="arrowDateBox1">
<div class="arrowDateBoxContent">Interviews</div>
</li>
<li class="arrowDateBox1Arrow">
</li>
<li class="arrowDateBox2">
<div class="arrowDateBoxContent">Offer Acceptance Deadline Date</div>
</li>
<li class="arrowDateBox2Arrow">
</li>
<li class="arrowDateBox1">
<div class="arrowDateBoxContent">ICRC Term Begins</div>
</li>
CSS
/* Generally for all boxes */
ul.arrowDateBoxes li {
display: inline;
float:left;
font-size:14px;
font-weight: bold;
}
/* Bi-color:
data boxes (arrowDateBoxN), width as % to be flexible, and
arrow boxes (arrowDateBoxNArrow), width as px to be fixed */
/* ----------------- */
.arrowDateBox1 {
background-color: #E8E8E8;
color: #143A66;
width: 12.5%;
height: 57px;
padding-left: 15px;
}
.arrowDateBox1Arrow {
background-image: url('../images/menuarrow-split1.svg');
background-repeat: no-repeat;
width: 30.5px;
height: 57px;
}
.arrowDateBox2 {
background-color: #A9CDF1;
color: #143A66;
width: 12.5%;
height: 57px;
padding-left: 15px;
}
.arrowDateBox2Arrow {
background-image: url('../images/menuarrow-split2.svg');
background-repeat: no-repeat;
width: 30.5px;
height: 57px;
}
Per request, the SVGs (bi-colored arrow splits):
<svg xmlns="http://www.w3.org/2000/svg" width="30.541" height="57.001" viewBox="0 0 30.541 57.001">
<g id="Group_225" data-name="Group 225" transform="translate(-312.858 -383.001)">
<path id="Polygon_30" data-name="Polygon 30" d="M28.5,0,57,18.143H0Z" transform="translate(331.001 383.002) rotate(90)" fill="#e8e8e8"/>
<path id="Subtraction_11" data-name="Subtraction 11" d="M18.4,57H0L18.142,28.5,0,0H18.4Z" transform="translate(325 383.001)" fill="#a9cdf1"/>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="30.541" height="57.001" viewBox="0 0 30.541 57.001">
<g id="Group_225" data-name="Group 225" transform="translate(-312.858 -383.001)">
<path id="Polygon_30" data-name="Polygon 30" d="M28.5,0,57,18.143H0Z" transform="translate(331.001 383.002) rotate(90)" fill="#a9cdf1"/>
<path id="Subtraction_11" data-name="Subtraction 11" d="M18.4,57H0L18.142,28.5,0,0H18.4Z" transform="translate(325 383.001)" fill="#e8e8e8"/>
</g>
</svg>
Change the ul to display:flex. It'll keep it all on one line. You can also probably cut out a fair amount of markup by using the ::after pseudo element for your arrows. Fire over the svg (or provide a link to it) and I'll have a look.
ul.arrowDateBoxes {
display:flex;
}
/* Generally for all boxes */
ul.arrowDateBoxes li {
list-style-type: none;
font-size: 14px;
font-weight: bold;
overflow: hidden;
}
/* Bi-color:
data boxes (arrowDateBoxN), width as % to be flexible, and
arrow boxes (arrowDateBoxNArrow), width as px to be fixed */
/* ----------------- */
.arrowDateBox1 {
background-color: #E8E8E8;
color: #143A66;
width: 12.5%;
height: 57px;
padding-left: 15px;
}
.arrowDateBox1Arrow {
background-image: url('../images/menuarrow-split1.svg');
background-repeat: no-repeat;
width: 30.5px;
height: 57px;
}
.arrowDateBox2 {
background-color: #A9CDF1;
color: #143A66;
width: 12.5%;
height: 57px;
padding-left: 15px;
}
.arrowDateBox2Arrow {
background-image: url('../images/menuarrow-split2.svg');
background-repeat: no-repeat;
width: 30.5px;
height: 57px;
}
I've updated this so you only need li elements
css
.arrowDateBoxes {
display: flex;
padding: 0;
font-size: 14px;
font-weight: bold;
}
.arrowDateBoxes>li {
position: relative;
list-style-type: none;
height: 57px;
padding-left: 15px;
margin-right: 29px;
}
.arrowDateBoxes>li:nth-child(odd) {
background-color: #E8E8E8;
color: #143A66;
}
.arrowDateBoxes li:nth-child(even) {
background-color: #A9CDF1;
color: #143A66;
}
.arrowDateBoxes>li::before {
position: absolute;
left: calc(100% - 1px);
content: '';
width: 30.5px;
height: 57px;
background-repeat: no-repeat;
}
.arrowDateBoxes li:nth-child(odd)::before {
background-image: url('menuarrow-split1.svg');
}
.arrowDateBoxes li:nth-child(even)::before {
background-image: url('menuarrow-split2.svg');
}
and html
<ul class="arrowDateBoxes">
<li>
Application Cycle Opens
</li>
<li>
Application Deadline
</li>
<li>
Reference Letter Deadline
</li>
<li>
Selections for Program Interviews
</li>
<li>
Interviews
</li>
<li>
Offer Acceptance Deadline Date
</li>
<li>
ICRC Term Begins
</li>
</ul>
I'm not 100% satisfied with it as setting overflow-y: hidden doesn't work as it causes a horizontal scroll bar to appear but gives you the general idea.

How to align icon with element instead of element text

I have a svg icon and a span element side by side. When the text overflows inside the span element, the svg also comes down along with it. I don't want it to happen.
Here is a of what I'm doing.
As you can see, the arrow icon is proper in Section 1 but in Section 2, it comes down with the text.
Here is the HTML code -
.rightContent {
border: 2px solid green;
height: 100vh;
overflow-y: scroll;
}
.sectionHeading {
background: #f7f9fa;
text-align: left;
font-family: sf pro display, -apple-system, BlinkMacSystemFont, Roboto, segoe ui, Helvetica, Arial, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol;
font-weight: 700;
line-height: 1.2;
letter-spacing: -.02rem;
font-size: 1rem;
padding-top: .75rem;
padding-bottom: 1.05rem;
}
.sectionHeading p {
padding: 0;
margin: 0;
}
.sectionHeading svg {
float: right;
}
.sectionHeading small {
font-size: 0.75rem;
font-weight: 500;
}
<div class="rightContent col col-lg-3 col-md-3 sol-sm-3" style="border: 2px solid green;">
<!-- Section 1: Introduction -->
<div class="row">
<div class="card">
<div class="sectionHeading">
<span>Section 1: Introduction</span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down" viewBox="0 0 16 16">
<path d="M3.204 5h9.592L8 10.481 3.204 5zm-.753.659 4.796 5.48a1 1 0 0 0 1.506 0l4.796-5.48c.566-.647.106-1.659-.753-1.659H3.204a1 1 0 0 0-.753 1.659z"/>
</svg>
<p></p>
<small>14 / 14 | 1hr 5min</small>
</div>
</div>
</div>
<!-- Section 2: Experience -->
<div class="row">
<div class="card">
<div class="sectionHeading">
<span>Section 2: Experiences In The Corporate World</span>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down" viewBox="0 0 16 16">
<path d="M3.204 5h9.592L8 10.481 3.204 5zm-.753.659 4.796 5.48a1 1 0 0 0 1.506 0l4.796-5.48c.566-.647.106-1.659-.753-1.659H3.204a1 1 0 0 0-.753 1.659z"/>
</svg>
<p></p>
<small>19 / 19 | 2hr 15min</small>
</div>
</div>
</div>
Most of the questions already present deal with aligning icons with text, but as I mentioned earlier, I want to align icons with span element and keep it fixed there, instead of aligning it with text.
Please feel free to share your inputs. I'll be grateful to learn from others since I'm still learning CSS. Thank you.
Please set max-width or width of span tag. As width svg tag is 16px, you can set that max-width of is calc(100% - 16px).
Try it
<style>
.sectionHeading span{
display: inline-block;
max-width: calc(100% - 16px);
}
</style>
In your case the best choice is using positions,using your .sectionHeading or.card as the relative element.
Try it:
.sectionHeading { /* you can also use your div .card */
position: relative;
}
svg { /* here you can also use a class name */
position: absolute;
top: 0;
right: 0;
}
Be in mind that maybe you will need to add a padding to your relative element, otherwise your svg will be leaning the border.
You had a few small problems like an empty p tag which I fixed.
I wrapped small & span tags in a container and Since you're using bootstrap, I added d-flex justify-content-between classes to sectionHeading. This fixed the problem.
* {
margin: 0;
padding: 0;
box-sizing: border-box
}
.rightContent {
border: 2px solid green;
height: 100vh;
overflow-y: scroll;
}
.sectionHeading {
background: #f7f9fa;
text-align: left;
font-family: sf pro display, -apple-system, BlinkMacSystemFont, Roboto, segoe ui, Helvetica, Arial, sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol;
font-weight: 700;
line-height: 1.2;
letter-spacing: -.02rem;
font-size: 1rem;
padding-top: .75rem;
padding-bottom: 1.05rem;
}
.sectionHeading p {
padding: 0;
margin: 0;
}
.sectionHeading svg {
float: right;
}
.sectionHeading small {
font-size: 0.75rem;
font-weight: 500;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<div class="rightContent col col-lg-3 col-md-3 sol-sm-3" style="border: 2px solid green;">
<!-- Section 1: Introduction -->
<div class="row">
<div class="card">
<div class="sectionHeading d-flex justify-content-between">
<div>
<span>Section 1: Introduction</span><br/>
<small>14 / 14 | 1hr 5min</small>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down" viewBox="0 0 16 16">
<path d="M3.204 5h9.592L8 10.481 3.204 5zm-.753.659 4.796 5.48a1 1 0 0 0 1.506 0l4.796-5.48c.566-.647.106-1.659-.753-1.659H3.204a1 1 0 0 0-.753 1.659z"/>
</svg>
</div>
</div>
</div>
<!-- Section 2: Experience -->
<div class="row">
<div class="card">
<div class="sectionHeading d-flex justify-content-between">
<div>
<span>Section 2: Experiences In The Corporate World</span><br/>
<small>19 / 19 | 2hr 15min</small>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down" viewBox="0 0 16 16">
<path d="M3.204 5h9.592L8 10.481 3.204 5zm-.753.659 4.796 5.48a1 1 0 0 0 1.506 0l4.796-5.48c.566-.647.106-1.659-.753-1.659H3.204a1 1 0 0 0-.753 1.659z"/>
</svg>
</div>
</div>
</div>

Font in Chrome is too fuzzy - how can I fix this?

I am using font Segoe UI and in a particular section on the site, the font is very blurred in Google Chrome.
I am also uploading the live site: http://impressivefirm.com/dynamics365
Below are the images for comparison:
Chrome
Firefox
I don't think this has anything to do with the selected font, although there might be fonts that don't exhibit this bug. Have a look at Woodrow's answer on a similar question.
In short, the problem's root is the fact you are skewing and translating twice in order to get the hex shape .
From a specific technical point of view, I think you'll only get a clear answer from someone with intimate knowledge on how Chrome's rendering engine works and specifically how anti-aliasing is applied to text.
What's notable is that it's a rendering engine with a fairly large usage, powering Chrome, Android Browser and Opera. I believe you're roughly looking at 60 - 70% of internet users.
Looking for a practical solution, you can get around your problem by having two separate containers, one on top of each other: one containing the background of the hex, without any contents (applying the correct shape) and one transparent, not rotated or skewed at all, with the actual text. This will bring you the disadvantage of having rectangular links when you probably want hexagonal links.
The second solution, and what I believe it's the proper way to make a hex grid is the clip-path technique, combined with proper margins alignment and possibly doable with flexbox.
Edit:
Here is a trimmed down and simplified version of your example, using clip-path. I tried to keep mods to your initial CSS to a minimum and only removed what was breaking my example. Here's what I did:
removed the skews
fixed responsiveness (paddings, widths and heights - you'll probably want to adjust font sizes line heights and other details yourself)
tried to keep as much as your existing markup and CSS
removed what was breaking responsiveness and simplified a few overly-complex solutions - at least from my perspective
I haven't used any tool to calculate angles. If you want them geometrically perfect you'll want to measure them and fine-tune heights
as a general rule, I tried to demonstrating a principle, not to provide a production ready version - you'll probably need to fine-tune the details
note this technique allows for perfect control over the link areas. Clickable areas are hexagonal and the space between hexagons is not linked.
#import url('https://fonts.googleapis.com/css?family=Noto+Sans:400,700');
body {font-family: 'Noto Sans', sans-serif;background-color: #369;}
#hexGrid {
display: flex;
flex-wrap: wrap;
max-width: 840px;
margin: 0 auto;
overflow: hidden;
font-size: 1.1066819197003217rem;
line-height: 1.5rem;
list-style-type: none;
padding: 48px 0;
}
.hex {
position: relative;
outline: 1px solid transparent;
-webkit-clip-path: polygon(50% 0%, 98% 25%, 98% 75%, 50% 100%, 2% 75%, 2% 25%);
clip-path: polygon(50% 0%, 98% 25%, 98% 75%, 50% 100%, 2% 75%, 2% 25%);
background-color: white;
margin-bottom: -7vw;
box-sizing: border-box;
height: 33vw;
}
#media (min-width: 680px) {
.hex {
height: 224px;
margin-bottom: -48px;
}
}
#media (max-width: 600px) {
.hex {
height: 50vw;
margin-bottom: -10.8vw;
}
}
.hex::after {
content: '';
display: block;
padding-bottom: 86.602%;
/* = 100 / tan(60) * 1.5 */
}
.hexIn {
position: absolute;
width: 96%;
margin: 0 2%;
height: 100%;
}
.hexIn * {
position: absolute;
visibility: visible;
}
.hexLink {
display: block;
width: 100%;
height: 100%;
text-align: center;
color: #fff;
overflow: hidden;
border: none;
}
/*** HEX CONTENT **********************************************************************/
.hex h1, .hex p, .hex .icon {
width: 100%;
box-sizing: border-box;
color: #000;
font-weight: 300;
}
.hex .icon {
height: 48px !important;
top: 45%;
display: block;
z-index: 2;
transform: translate3d(0,-100%,0);
}
.hex p {
top: 60%;
z-index: 1;
transform: translate3d(0,-100%,0);
}
.hex h1 {
top: 27%;
transform: translate3d(0,100%,0);
font-size: 20px !important;
letter-spacing: 1px;
}
/*** HOVER EFFECT **********************************************************************/
/*
*.hexLink:hover h1, .hexLink:focus h1,
*.hexLink:hover p, .hexLink:focus p{
* -webkit-transform:translate3d(0,0,0);
* -ms-transform:translate3d(0,0,0);
* transform:translate3d(0,0,0);
*}
*
*/
/*** HEXAGON SIZING AND EVEN ROW INDENTATION *****************************************************************/
#media (min-width:1201px) {
/* <- 5-4 hexagons per row */
#hexGrid {
padding-bottom: 4.4%;
}
.hex {
width: 25%;
/* = 100 / 5 */
}
.hex:nth-child(7n+5) {
/* first hexagon of even rows */
margin-left: 12.5%;
/* = width of .hex / 2 to indent even rows */
}
}
#media (max-width: 1200px) and (min-width:901px) {
/* <- 4-3 hexagons per row */
#hexGrid {
padding-bottom: 5.5%;
}
.hex {
width: 25%;
/* = 100 / 4 */
}
.hex:nth-child(7n+5) {
/* first hexagon of even rows */
margin-left: 12.5%;
/* = width of .hex / 2 to indent even rows */
}
}
#media (max-width: 900px) and (min-width:601px) {
/* <- 3-2 hexagons per row */
#hexGrid {
padding-bottom: 7.4%;
max-width: 640px;
}
.hex {
width: 33.333%;
/* = 100 / 3 */
}
.hex:nth-child(5n+4) {
/* first hexagon of even rows */
margin-left: 16.666%;
/* = width of .hex / 2 to indent even rows */
}
}
#media (max-width: 600px) {
/* <- 2-1 hexagons per row */
#hexGrid {
padding-bottom: 11.2%;
}
.hex {
width: 50%;
/* = 100 / 3 */
}
.hex:nth-child(3n+3) {
/* first hexagon of even rows */
margin-left: 25%;
/* = width of .hex / 2 to indent even rows */
}
}
#media (max-width: 400px) {
#hexGrid {
font-size: 13px;
}
}
<ul id="hexGrid">
<li class="hex">
<div class="hexIn">
<a class="hexLink" href="https://www.microsoft.com/en-us/dynamics365/sales" target="_blank">
<div class="filler"></div>
<svg class="icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="assets/vectors/sprite.svg#strengthandscale"></use>
</svg>
<p>Dynamics 365 for</p>
<h1>Sales</h1>
</a>
</div>
</li>
<li class="hex">
<div class="hexIn">
<a class="hexLink" href="https://www.microsoft.com/en-us/dynamics365/customer-service" target="_blank">
<svg class="icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="assets/vectors/sprite.svg#customer-service"></use>
</svg>
<p>Dynamics 365 for</p>
<h1>Customer Service</h1>
</a>
</div>
</li>
<li class="hex">
<div class="hexIn">
<a class="hexLink" href="https://www.microsoft.com/en-us/dynamics365/operations" target="_blank">
<svg class="icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="assets/vectors/sprite.svg#operations"></use>
</svg>
<p>Dynamics 365 for</p>
<h1>Operations</h1>
</a>
</div>
</li>
<li class="hex">
<div class="hexIn">
<a class="hexLink" href="https://www.microsoft.com/en-us/dynamics365/financials" target="_blank">
<svg class="icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="assets/vectors/sprite.svg#financials"></use>
</svg>
<p>Dynamics 365 for</p>
<h1>Financials</h1>
</a>
</div>
</li>
<li class="hex">
<div class="hexIn">
<a class="hexLink" href="https://www.microsoft.com/en-us/dynamics365/field-service" target="_blank">
<svg class="icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="assets/vectors/sprite.svg#field-service"></use>
</svg>
<p>Dynamics 365 for</p>
<h1>Field Service</h1>
</a>
</div>
</li>
<li class="hex">
<div class="hexIn">
<a class="hexLink" href="https://www.microsoft.com/en-us/dynamics365/project-service-automation" target="_blank">
<svg class="icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="assets/vectors/sprite.svg#project-service"></use>
</svg>
<p>Dynamics 365 for</p>
<h1>Project Service</h1>
</a>
</div>
</li>
<li class="hex">
<div class="hexIn">
<a class="hexLink" href="https://www.microsoft.com/en-us/dynamics365/marketing" target="_blank">
<svg class="icon">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="assets/vectors/sprite.svg#marketing"></use>
</svg>
<p>Dynamics 365 for</p>
<h1>Marketing</h1>
</a>
</div>
</li>
</ul>
Side notes:
I'm not exactly a fan of responsiveness by percent padding, so I removed part of it, as it was really messing up responsiveness.
from where I see it, your markup and CSS are unnecessarily complex and that's the root of the problem. CSS should be kept as simple and controllable as possible.
I resolved the issue by going in Chrome to SETTINGS>>>ADVANCED>>>SYSTEM and turned off/disabled "Use Hardware Acceleration When Possible". I've seen this type of error before in the XP era - related to certain graphic driver/updates - which affected Adobe reader/full products. Remove the drivers (version translation) component specific to the browser and and the apps will default to the OS settings.

Add image into list through SVG

I am trying to get this working for the contact area: http://jsfiddle.net/y8zx3/
CSS:
#container #sidebar ul.kontakt { list-style: none }
#container #sidebar ul.kontakt li {
/* display: block; */
line-height: 70px;
margin-right: 50px;
float: right;
display: list-item;
}
#container #sidebar ul.kontakt li svg {
/* position: relative;;*/
float: left;
}
#container #sidebar ul.kontakt li a {
/* display: block; */
line-height: 70px;
margin: 0;
float: right;
}
HTML:
<h1>Kontakt</h1>
<p>Schön, das Sie uns kontaktieren wollen. Sie können uns entweder per Kontaktformular erreichen, oder ganz traditionell per Telefon, Email oder Fax.</p>
<ul class="kontakt">
<li>
<svg height="50px" id="Layer_1" style="enable-background:new 0 4 512 512;" version="1.1" viewBox="0 0 512 512" width="512px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
<g>
<polygon points="448,384 448,141.8 316.9,241.6 385,319 383,321 304.1,251.4 256,288 207.9,251.4 129,321 127,319 195,241.6 64,142 64,384 " />
<polygon points="439.7,128 72,128 256,267.9 " />
</g>
</svg>info#immobilienverwaltung-buerk.de
</li>
<li>+49 (0) 7127 980 1493
<li>+49 (0) 7127 980 1489</li>
<li>+49 (0) 160 16 25 175</li>
</ul>
I want the email icon to be at the left of the list, but dont want to do this using css background-image. How could I achieve this? right now the image is above the li and not in front. Btw the icon is an inline SVG. See http://jsfiddle.net/y8zx3/ for full co
I did a little bit of CSS editing using Chrome's Developer Tools (Very Useful!)
/* On #container #sidebar ul.kontakt li */
width: 100%;
text-align: right;
/* On #container #sidebar ul.kontakt li svg */
margin: 10px 0 0 10px;
Is this what you are looking for? http://jsfiddle.net/bnkAL/
Edit #1
Set the width of the SVG from 512px to 50px ... The SVG is expanded past the <li>, pushing the <a> tag down.
...viewBox="0 0 512 512" width="50px" x="0px"...