Why is scroll-behavior:smooth not working but javascript window.scroll smooth is?

I have a navigation bar to scroll down to anchor elements. The navbar is inside the body. My css : body { scroll-behavior: smooth; } In the page, I also use some javascript. One is a javascript with the following function to navigate to other page elements : window.scroll({ top : pos, left : 0, … Read more

Prevent absolutely-positioned elements from overlapping with text

I have a unique situation here. Essentially, I have an absolutely positioned block of text, which must be absolutely positioned due to design limitations. I also have the rest of my text, which is normally positioned. However, I need to prevent my normal text from overlapping with my original text. Is this possible simply with … Read more

How to create TCPDF HTML table with variable row paddings

I’m trying to create an HTML table in TCPDF, with few rows having grater space between rows (padding), and others having smaller padding. $html = ‘<table border=”0″ cellpadding=”6″> <tr> <td style=”width=”52%”>’ . lang(‘ticket_name’) . ‘</td> <td style=”width=”18%”>’ . lang(‘ticket_price’) . ‘</td> <td style=”width=”12%”>’ . lang(‘quantity’) . ‘</td> <td style=”width=”18%”>’ . lang(‘total’) . ‘</td> </tr> <tr> … Read more

Position AFTER transform in CSS?

Consider the following attempt to rotate a paragraph 90 degrees and position it so that the corner that was initially its top-left corner (and which therefore becomes its top-right corner after the rotation) ends up located at the top-right corner of the parent block. HTML: <!DOCTYPE html> <html> <body> <div id=”outer”> <p id=”text”>Foo bar</p> </div> … Read more

How to add media attribute to ASP.NET MVC4 style bundle

In ASP.NET MVC4 application, style bundle is created using bundles.Add(new StyleBundle(“~/css/pos.css”) .Include(“~/css/mypos.css”)); and rendered in view as @Styles.Render(“~/css/pos.css”) Generated output in debug mode is <link href=”/myapp/css/mypos.css” rel=”stylesheet”/> How to add media attribute to output so that style is used for screen <link href=”/myapp/css/mypos.css” media=”screen” rel=”stylesheet”/> or for print <link href=”/myapp/css/mypos.css” media=”print” rel=”stylesheet”/> Or is there … Read more

How to set Safari print margins via CSS to print borderless

I want to print a webpage to PDF without any margins in Safari. Page size is set to ‘A4 borderless’ in the print dialogue. Whatever I seem to do, Safari on OSX is adding an extra margin around my HTML. Check ‘print backgrounds’ to see what I mean. Clearly the @page-rule has no effect for … Read more