CSS Browser Compability Border Bug using TailwindCSS - html

I'm having a little browser compatibility problem right now and couldn't find a working solution. When copying an HTML element, the content is rendered differently depending on the browser. In Firefox, everything works fine. However, in Chrome and Brave, a gray border is put around all content.
My goal is to achieve a working method to copy the content into the clipboard and pasting at in Outlook and other Mail programs in the right style.
<div style="font-family:Verdana,Roboto,helvetica,sans-serif;font-size:9.75pt;color:#000;line-height:normal;margin: 0 0 2px;!important; border: none;">
<div class="border-none border-transparent border-0">
</div>
</div>
I use TailwindCSS and have already tried border-0, border-none and even border-transparent. The gray box remains when the clipboard is inserted. Through my DevTools, I was able to figure out that it is actually due to the "border-style: solid;" value. By using border-none over the content I should be able to override a global value though, right? (Already tried !important, doesn't change anything).

Related

Making Blogger post and page background transparent

I need to get the area outlined in red in the image below completely transparent. I'm new to this HTML stuff, but I've tried searching for transparency and opacity in the HTML editing section and I don't seem to be able to find the correct bit to edit.
If there's a simple CSS code someone could provide me with that would be even better.
I'm using the Picture Window theme on Blogger.
Thanks :)
The CSS I would use is background-color: rgba(0,0,0,0); (red,green,blue,alpha)
for alpha, 0 is transparent, 1 is solid, so 0.5 would be halfway transparent
If you are unsure where to put this css, you'll need to identify the div; you can use developer tools in most popular browsers to find the ID or Class of the div; right click on it and choose "Inspect" or "Inspect element" or similar.
EDIT:
The div you need to alter is <div class="content-outer">....</div>
add the style background:none; to remove the existing background.
<div class='content-outer' style="background:none;box-shadow:none;">
<div class='content-cap-top cap-top'>
<div class='cap-left'/>
<div class='cap-right'/>
</div>
see here
If you want to ensure the box-shadow (fuzzy outline) does not appear on older browsers, see https://www.w3schools.com/cssref/css3_pr_box-shadow.asp for browser specific css. For example for older versions of chrome you would also add -webkit-box-shadow:none;

Need to trump generated inline css

I am working on editing our intranet site and basically all I am able to change is the CSS. Although I have gotten it to look like I want with these limitations, I have one little snag. If I was told correctly, the html is generated via a .aspx file, and in this html is the inline CSS applied to the navigation menu of
border-collapse: collapse;
When I preview it in Chrome and Firefox it works fine, but when I view it in IE10, the navigation is pushed to the left. If I disable it using the developer tools, it works fine, but I can't access the html since it is generated, so I can't, at lease as far as I know, create a rule that can trump it. I have zero experience with ASP, but I have opened the file and looked through it, but it's all greek to me. Any thoughts? TIA!
Use !important in your stylesheet to override the inline value, like this:
Inline style:
<div style="background: red;">
The inline styles for this div should make it red.
</div>
Stylesheet:
div[style] {
background: yellow !important;
}
Note: This will result in a div with a yellow background, even though the inline style said for the background to be red.

CSS style being overridden in Firefox

this problem has had me stumped all day. I'm using Firefox 8 and I have a UL element that's located inside a div tag, the div tag is animated with the jQuery UI Accordion widget as the following markup shows:
<div id="accordion">
<a class="ui-accordion-header">Section 1</a>
<ul style="width: 250px !important;">
<li>
<dl id="MyDefinitionList"></dl>
</li>
</ul>
</div>
My problem is that in Firefox the inline width style for the tag gets overwritten and reset to 0px. So the above ends up getting rendered in Firefox as follows:
<div id="accordion">
<a class="ui-accordion-header">Section 1</a>
<ul style="width: 0px;">
<li>
<dl id="MyDefinitionList"></dl>
</li>
</ul>
</div>
This does not happen in Chrome or IE and I have no idea what is causing this in FF. Ideally I would like to set the width dynamically from jQuery, I tried .width(250) and .css("width", "250px") but neither has any effect, I had just set it inline in the example above to test and sure enough it gets overwritten and reset back to 0px. Is there some browser setting or feature in the Firefox rendering engine that causes this behavior. I also tried checking the styles in the jQuery UI CSS, but didn't see anything that defined the width as 0px. Any help is appreciated as we are currently trying to get this web app pushed out and it must be cross-browser compatible. Thanks.
UPDATE:
One thing I forgot to mention this snippet is part of a dynamic Javascript menu system. I don't think I can replicate it on jsFiddle in it's entirety. I'm wondering if the menu generation has anything to do with it? Although there's nothing in the menu code or CSS that specifies a width of 0px. Nor does it explain why this happens in Firefox and not IE or Chrome.
UPDATE 2
Here are some snapshots from Chrome compared to Firefox
Note in Chrome the width I calculate dynamically using jquery is applied to the element.style property as expected.
But in Firefox, the element.style is reset to 0px upon page render.
Css also follow the inheritence.. some css properties are inherited from parent controls css.
as like from body tag and other parents..
use FireBug to check all of this for cross browser issues and better UI design. I am attaching an image that showing such inhertence.
hope you will get the idea about this..
if you want to give preference to some css property must not effected by parent inherited properties then use !important with them.
e.g.
a{ display: block !important; }
may be you will get little idea from this..
if you are adding stuff at run time then observer the changes in firbug and correct the GUI according your requirements and then use .addCss() on the place of .css().
api.jquery.com/addClass/

Checkbox and dropdown arrows invisible in chrome

For some reason my checkboxes and dropdown arrows are not visible in chrome, however, they still work.
They are perfectly visible in IE. When I load the page in IE, then try loading the page in chrome, they usually appear until I refresh the page again in chrome.
Anyone know what the problem might be?
Reference image: http://i.imgur.com/Q66w6.png
A 'solution' to this Chrome problem is to
open Task Manager
refresh the page in Chrome while the Taks Manager is open in front of the browser.
I couldn't believe this would actually work when I read about it, but I've seen it with my very eyes. This issue apparently exists since the early versions of Chrome and still exists in current versions, though it only occasionally occurs. It seems to be permanently gone after this 'fix'.
In webkit browsers the following code will remove dropdown arrows.
select{
-webkit-appearance:none;
}
Checking in your browsers inspector will indicate if it's being applied in your case or not.
Found this question while having the same problem.
Setting:
input {
width:100%
}
was the cause of the problem for me. This:
input[text] {
width:100%
}
was what I wanted (leave checkbox widths unchanged) -- setting the width of checkboxes in chrome seems to make them disappear.
As user48956 mentioned; setting input width to 100% causes checkboxes to vanish in chrome.
I use bootstrap and often have forms where I want all inputs to stretch 100% and don't want to use bootstraps form methods and this issue still comes up.
If you have defined input {width:100%} you can put a width on the div containing the checkbox and it will fix. e.g.
<div style="display:inline-block; width:20px"><input type="checkbox" name="read_privacy_policy" id="read_privacy_policy" class="pull-left"></div>
<div style="display:inline-block">I have read and understand the Privacy Policy.*</div>
or you can set style="width:auto" on the input itself
I had the same issue
Try this css style supression all style that acts in the input checkbox element.
-webkit-appearance: checkbox!important;
I think it's a bug and it's still there. I use checkboxes in a ligthbox window and they don't show. I'm on OS-X using Chrome 21.

IE page-breaking issue

In Google Chrome (And I think firefox?) a page renders correctly
But in IE, the page appears to be "transparent", see This image.
<div style="margin-left:-10px;float:left;width:130px;height:30px; background-image:url('/gc_mycoinamount_display.png');">
<div id="mygoldamount" style="margin-top:7px;">5 Coins</div>
I believe this div causes the issue, when I remove it, the page looks correct. Is the CSS on it incorrect?
I needed to close a div, silly me.
<div style="margin-left:-10px;float:left;width:130px;height:30px; background-image:url('/gc_mycoinamount_display.png');">
<div id="mygoldamount" style="margin-top:7px;">5 Coins</div></div>