Style is not applied after sanitization and [innerHTML]

Issue I have a mat-table: <ng-container matColumnDef="quantity"> <th mat-header-cell *matHeaderCellDef> Operation </th> <td mat-cell *matCellDef="let element" class=’operation’ [innerHTML]=’quantity(element.quantity)’> </td> </ng-container> table-component.ts quantity(numbers: number[]) : any { return this.sanitizer.bypassSecurityTrustHtml( numbers.map(n => n > 0 ? `<span class="add">+ ${n}</span>` : `<span class="remove">

Continue reading

CSS3 fading out text

Issue I’ve been trying to get my text to fade out. I’ve tried some codes I’ve found on the internet, but they seem to be only for block elements. Solution Never mind, I’ve found my own solution. blablablabla<span class=”readmore”>blablablabla</span> .readmore

Continue reading

Why is my button not appearing on the page?

Issue I have this form in a partial: <%= form_for current_user.relationships.build(:followed_id => @profile.user.id) do |f| %> <div><%= f.hidden_field :followed_id %></div> <div class=”follow_button”><%= f.submit “Follow” %></div> <% end %> that is rendered to my profile view. Here is the resulting html:

Continue reading

html space which belongs to no html tag

Issue I have this html code <img src="/static/media/call-of-duty-mobile-promo-banner.c6a9b17af598e76351f1.jpg" id="banner" alt=” /> <div id="DIV_1"> <div id="DIV_2"> <div id="DIV_3"> login </div> </div> <div id="DIV_4"> <img src=’cart.jpg’></img> </div> </div> but there is a white space between first img and div with id DIV_1

Continue reading

Simulation background-size: cover in canvas

Issue I’m drawing images on a canvas like this: ctx.drawImage(data[i].image, data[i].pos.x, data[i].pos.y, data[i].pos.w, data[i].pos.h); The picture is getting stretched and I don’t want this. How can I simulate the CSS property? background-size: cover when drawing images on the canvas? http://www.w3schools.com/cssref/playit.asp?filename=playcss_background-size&preval=cover

Continue reading

Hiding Google Translate bar

Issue I have the following code: <div style=”” class=”skiptranslate”> <iframe frameborder=”0″ style=”visibility:visible” src=”javascript:”” class=”goog-te-banner-frame skiptranslate” id=”:2.container”></iframe> </div> I need to hide it but if I only hide the goog-te-banner-frame using: .goog-te-banner-frame { display:none !important } It still throws my header

Continue reading

Increase input field width

Issue I am new to Tailwind CSS and am trying to make a responsive search bar. When I increase the width it becomes unresponsive. How can I fix this? <form className="flex items-center mx-4" onSubmit={submitHandler}> <label htmlFor="simple-search" className="sr-only">Quick search</label> <div className="relative

Continue reading

CSS grid is overflowing

Issue I am trying to create a CSS grid. This is my HTML code: <div id="updates" class ="wrapper"> <div id="content"> <section id="services" class="last clear"> <ul> <li> <article class="clear"> <figure><img src="images/demo/180×150.gif" alt=""> <figcaption> <h2>Indonectetus facilis leo nibh</h2> <p>content content content <a

Continue reading

Make circle on same image

Issue I am using below image. Now I want to clickable all circle. This is a simple image. Every circle will redirect to different different links. Is this possible? Solution Html image maps may be the fitting tool. Conceptually the

Continue reading

Rotate image on hover

Issue I’m trying to make this image rotate 360 degrees when it it hovered over, but it does not rotate and moves to a random location when it is hovered over. I have tried changing its location on the page

Continue reading

Assistance with sliding menu items

Issue Here’s my menu: <ul class="menu"> <li><img src="#" title="???"/></li> <li>Home<img src="#" title="Home"/></li> <li>Forums<img src="#" title="Forums"/></li> <li>Chat Rooms<img src="#" title="Chat Rooms"/></li> <li>Messages<img src="#" title="Messages"/></li> <li>Profile<img src="#" title="Profile"/></li> <li>News<img src="#" title="News"/></li> <li>Help/FAQ<img src="#" title="Help/FAQ"/></li> </ul> Here’s my CSS: body { background-color: lightred;

Continue reading

Show/Hide Divs by name in jQuery

Issue I have the following JavaScript at the end of the body of my HTML: <script> $(document).ready(function() { $("a").click(function(event) { var div_to_show=event.target.id; var real_div=div_to_show.split(‘-‘); var display_div=real_div[0]; var elementPos=$("#"+div_to_show).offset(); var top_pos=elementPos.top-118.5; $(‘#board-right div’).hide(); $("#" + display_div).css(‘margin-top’,top_pos); $("#" + display_div).show(); }); });

Continue reading