Align icon vertically to the center of the first line of text

I found the solution: http://jsfiddle.net/sqp1wdap/3/ Align both Eye and Text to flex-start Make line-height for text same as Eye height Here is the edited code: .LegendItem_Eye { width: $slotWidth; display: flex; justify-content: center; align-items: flex-start; // ← edit (1) background: #eee; } .LegendItem_Text { padding: 0 3px; flex: 1; align-self: flex-start; // ← edit (1) … Read more

Centering a div vertically & horizontally using jQuery

I normally use this “technique”: $(function() { $(‘.className’).css({ ‘position’ : ‘absolute’, ‘left’ : ‘50%’, ‘top’ : ‘50%’, ‘margin-left’ : -$(‘.className’).width()/2, ‘margin-top’ : -$(‘.className’).height()/2 }); }); UPDATE: I’m updating the solution, as suggested by the user Fred K, using .outerWidth() and .outerHeight() to have a more precise centering. $(function() { $(‘.className’).css({ ‘position’ : ‘absolute’, ‘left’ : … Read more

Vertically center text in a 100% height div?

The best and easiest way to do it (currently in 2015 2020) is using flexbox: .parent-selector { display: flex; align-items: center; } And that’s it šŸ˜€ Check-out this working example: div { border: 1px solid red; height: 150px; width: 350px; justify-content: center; /* Actual code */ display: flex; align-items: center; } <div> <p>Hola</p> </div> Old … Read more

Center text in circle with SVG

Add text-anchor=”middle” to the text element. Plunker <svg xmlns=”http://www.w3.org/2000/svg” xmlns:xlink=”http://www.w3.org/1999/xlink” xml:space=”preserve” style=”shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd” viewBox=”0 0 500 500″> <g id=”UrTavla”> <circle style=”fill:url(#toning);stroke:#010101;stroke-width:1.6871;stroke-miterlimit:10;” cx=”250″ cy=”250″ r=”245″> </circle> <text x=”50%” y=”50%” text-anchor=”middle” stroke=”#51c5cf” stroke-width=”2px” dy=”.3em”>Look, I’m centered!Look, I’m centered!</text> </g> </svg>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)