css

CSS width 100% height auto GTMetrix & Google Web.dev properly size images

孤街醉人 提交于 2021-02-10 06:32:12
问题 When using GTMetrix, the following CSS yields "Properly size images" and Google's Web.dev doesn't display "Displays images with incorrect aspect ratio" figure.dhero { position: relative; } figure.dhero::after { content: ''; display: block; overflow: hidden; height: 0; width: 100%; padding-bottom: 66.5492958%; } figure.dhero > * { position: absolute; top: 0; left: 0; max-width:100%; min-width:100px; min-height:100px; display: block; z-index: 2; } In contrast, GT Metrix doesn't display the

Multi select dropdown showing additional dropdown

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 06:29:06
问题 I am creating a multi-select dropdown using bootstrap this is the html : <form id="multiselectForm" method="post" class="form-horizontal"> <div class="form-group"> <label class="col-xs-3 control-label">Browser</label> <div class="col-xs-5"> <select class="form-control" name="browsers" multiple="multiple"> <option value="chrome">Google Chrome</option> <option value="firefox">Firefox</option> <option value="ie">IE</option> <option value="safari">Safari</option> <option value="opera">Opera<

Set css style on first row of the table on case first row has rowspan

人盡茶涼 提交于 2021-02-10 06:22:39
问题 I have many table, want to set css style on first row of the table on case first row has rowspan. <table> <tbody> <tr> <td rowspan="2" width="110">Name</td> <td width="110">Size</td> <td width="110">Status</td> </tr> <tr> <td>Meter</td> <td>true/false</td> </tr> <tr> <td>Code A</td> <td>1</td> <td>false</td> </tr> </tbody> </table> With this style I tried to change first row: thead tr:first-child, tbody tr:first-child { background-color: #1DA6C0;color: #fff; } So I looking for a css style to

How to make Bootstrap dropdown respect horizontal viewport limits on mobile?

白昼怎懂夜的黑 提交于 2021-02-10 06:18:07
问题 Bootstrap class dropdown-menu can autodetect the viewport of the screen and adapt accordingly So if there is no room for the dropdown to open to the bottom it opens up, as shown by the example bellow However it doesn't happen for the horizontal limits of the viewport, and I end up getting this horizontal scroll, here's an example of this happening: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs

Is editing the <title> text using css possible? [duplicate]

孤街浪徒 提交于 2021-02-10 06:08:14
问题 This question already has answers here : Can we set style to title tag in header (6 answers) Closed 4 years ago . Can't find the answer anywhere, is there a way to edit the <title>exampletext</title> using css to give it for example a 'bold' weight or color: red? 回答1: No, but in js you can edit or modify title itself but no way to apply css sorry <script type="text/javascript"> $(document).ready(function() { document.title = 'new title'; }); </script> however you can do something like head {

Is editing the <title> text using css possible? [duplicate]

北城余情 提交于 2021-02-10 06:01:53
问题 This question already has answers here : Can we set style to title tag in header (6 answers) Closed 4 years ago . Can't find the answer anywhere, is there a way to edit the <title>exampletext</title> using css to give it for example a 'bold' weight or color: red? 回答1: No, but in js you can edit or modify title itself but no way to apply css sorry <script type="text/javascript"> $(document).ready(function() { document.title = 'new title'; }); </script> however you can do something like head {

Is editing the <title> text using css possible? [duplicate]

非 Y 不嫁゛ 提交于 2021-02-10 06:01:20
问题 This question already has answers here : Can we set style to title tag in header (6 answers) Closed 4 years ago . Can't find the answer anywhere, is there a way to edit the <title>exampletext</title> using css to give it for example a 'bold' weight or color: red? 回答1: No, but in js you can edit or modify title itself but no way to apply css sorry <script type="text/javascript"> $(document).ready(function() { document.title = 'new title'; }); </script> however you can do something like head {

Append element to div starting at the bottom?

佐手、 提交于 2021-02-10 06:00:35
问题 I have the following code: $('button').click(function() { $('#parent').append('<div>element</div>'); }); #parent { height: 200px; width: 100px; border: 1px solid #ccc; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="parent"></div> <button> Add </button> https://jsfiddle.net/8ybnycxv/1/ When the button is clicked, I want to append a div element to the #parent . However, if there is no element in the #parent yet, elements will be added

Truncate text for dynamic width (Responsive) through CSS

眉间皱痕 提交于 2021-02-10 05:46:31
问题 In the Fiddle link , you can see image with some content. What I want is .g_container li strong should get truncated with dynamic width but now its getting hidden. Its width should stop spreading with image width. now I gets hidden and (3 dots) ... were not visible even if I use text-overflow:ellipsis .g_container li strong { text-align: center; font-size: 13px; font-weight: bold; padding: 8px 10px 4px !important; line-height: 30px; color: #000; text-transform: uppercase; height: 30px;

Replace CSS “#” (ID) with .(Class)

天涯浪子 提交于 2021-02-10 05:36:06
问题 I've a CSS string like #xyz{ color:#ee2ee2; } .abc{ background-color:#FFFFFF; border-color:1px solid #eee; } .def #xyz{ border-color:1px solid #ddd; } I need to replace the #xyz (or any other ID selector) with .xyz without changing the color: #ee2ee2 (or any other color selector). Basic java-script code would do I've tried some regex but it fails a few cases cssText.replace(/#([a-zA-Z])/gm, '.$1'); 回答1: This will replace # with . only when there is a { somewhere after in the same line.