Why the same font size gives different results?

Why font size is different in divs? <div style=”font-size: 30px;”> <h1>Sample text</h1> </div> <div> <h1 style=”font-size: 30px;”>Sample text</h1> </div> Why is this happening? >Solution : The default value for h1 tag in Chrome is 2em. Ems are relative to the font size set in the CSS (parent element). So in your second div you are… Read More Why the same font size gives different results?

Why border-top doesn't give same border width while using display:table in div area?

I have the following HTML file: index.html @import url(‘https://fonts.googleapis.com/css?family=Open+Sans&#8217;); .div_table { display: table; border-collapse: collapse; } .div_table_row { display: table-row; } .div_table_header { font-weight: bold; text-align: center; } .div_table_cell { display: table-cell; padding-left: 10px; padding-right: 10px; font-family: “Open Sans”; font-size: 11px; border-top: 1px solid #000000; } <!doctype html> <html lang=”en”> <head> <meta charset=”utf-8″> <meta name=”viewport”… Read More Why border-top doesn't give same border width while using display:table in div area?

Want to show date counter

I want to make date counter in following codes. the format must be today’s date – previous date. I tried to add but I think the format is wrong. Can you guys please check? if (mysqli_num_rows($result) > 0) { $row = mysqli_fetch_array($result); $curr_dt = DateTime::createFromFormat("Y-m-d H:i:s", date("Y-m-d") . " 00:00:00"); $row_dt = DateTime::createFromFormat("Y-m-d H:i:s", $row["dt_corr"]);… Read More Want to show date counter

Operator function defaults to first if statement in JavaScript calculator project

I’m creating a calculator with JavaScript and most functions are working properly, but the operator function defaults to the first if statement each time (I switched add with subtract to test this). i.e. if the add function is in the first if statement of my operator function, every operator button will add the numbers instead… Read More Operator function defaults to first if statement in JavaScript calculator project