css-reset

How can I prevent CSS from affecting certain element?

China☆狼群 提交于 2019-12-02 01:15:15
I am writing a GreaseMonkey script that sometimes creates a modal dialog – something like <div id="dialog"> Foo </div> . But what can I do if the site has something like #dialog { display: none !important; } ? Or maybe the owner of some site is paranoid and has something like div { display: none !important; } div.trusted { display: block !important; } because he doesn't want people like me adding untrusted content to his page. How can I prevent those styles from hiding my dialog? My script runs on all pages, so I can't adapt my code to each case. Is there a way to sandbox my dialog? Actually a

How to line up HTML input elements?

强颜欢笑 提交于 2019-11-30 11:24:06
问题 I am hoping to find a resource for lining up input elements in a HTML page. I find it difficult to get a select element and a text box to be the same width even when using the width style attribute, and it is even more difficult across browsers. Finally, file inputs seem impossible to get to the same width cross browser. Are there any good guides or tips for accomplishing this? Perhaps there are some default CSS attributes I should be setting. 回答1: I tested this out in Internet Explorer 7,

Very different font sizes across browsers

邮差的信 提交于 2019-11-30 05:21:39
问题 Update : Added simple test example http://jsfiddle.net/7UhrW/1/ using normalize.css. Chrome/WebKit and Firefox have different rendering engines which render fonts differently, in particular with differing dimensions. This isn't too surprising, but what's surprising is the magnitude of some of the differences. I can always tweak individual elements on a page to be more similar, but that's tedious, to say the least. I've been searching for more systematic solutions, but many resources (e.g. SO

How to line up HTML input elements?

孤街醉人 提交于 2019-11-30 00:05:59
I am hoping to find a resource for lining up input elements in a HTML page. I find it difficult to get a select element and a text box to be the same width even when using the width style attribute, and it is even more difficult across browsers. Finally, file inputs seem impossible to get to the same width cross browser. Are there any good guides or tips for accomplishing this? Perhaps there are some default CSS attributes I should be setting. cowgod I tested this out in Internet Explorer 7, Firefox 3 and Safari/Google Chrome. I definitely see the problem with <select> and <input type="file">

CSS reset for HTML5

空扰寡人 提交于 2019-11-29 12:12:17
问题 Best practices? How does this differ from HTML4 or XHTML1? There's a lot of discussion going on over here: http://html5doctor.com/html-5-reset-stylesheet/ I'm wondering what other resources/discussion exists. 回答1: The comments on that post are crazy. You're certainly not going to find a more thorough discussion. I think you should delete unnecessary rules and deprecated tags from whatever reset you've been using and keep truckin. Paul Irish (jQuery core contributor, co-creator of Modernizr

Should I use normalize.css in my Bootstrap project?

馋奶兔 提交于 2019-11-28 16:10:23
问题 I can't figure out if I need to add the normalize.css stylesheet in my bootstrap project. I'm using the latest version of bootstrap, v2.3.2. 回答1: No, you shouldn't. A modified version of normalize.css is already included in Bootstrap 2.3.2. Here it is. UPDATE: the docs makes this even more explicit, and now they use the original code, not their fork. UPDATE: (Bootstrap 4) For improved cross-browser rendering, we use Reboot to correct inconsistencies across browsers and devices while providing

CSS Reset, default styles for common elements

ⅰ亾dé卋堺 提交于 2019-11-27 18:06:27
After applying a CSS reset, I want to get back to 'normal' behavior for html elements like: p, h1..h6, strong, ul and li. Now when I say normal I mean e.g. the p element adds spacing or a carriage return like result when used, or the size of the font and boldness for a h1 tag, along with the spacing. I realize it is totally up to me how I want to set the style, but I want to get back to normal behavior for some of the more common elements (at least as a starting point that I can tweak later on). Steven Oxley YUI provides a base CSS file that will give consistent styles across all 'A-grade'

Why don't CSS resets use '*' to cover all elements?

别来无恙 提交于 2019-11-27 05:17:09
For example, the Meyer reset has a long list of elements 1 which I believe can be replaced with a * ? I have seen some use of: * { margin: 0; padding: 0; } But more "advanced" resets seem to go with explicitly stating the tags. The only elements I don't see covered in the tag list that are covered (I presume) with a * are input , button , and select —the Eric Meyer reset, in fact, doesn't appear to really deal with those elements at all. If avoiding resetting these elements is the issue…why wouldn't you? Browsers obviously don't all display form elements the same. 1 html, body, div, span,

Turn off iPhone/Safari input element rounding

老子叫甜甜 提交于 2019-11-26 23:15:16
My website renders well on the iPhone/Safari browser, with one exception: My text input fields have a weird rounded style which doesn't look good at all with the rest of my website. Is there a way to instruct Safari (via CSS or metadata) not to round the input fields and render them rectangular as intended? On iOS 5 and later, good ol' border-radius does the trick: input { border-radius: 0; } If you must only remove the rounded corners on iOS or otherwise for some reason cannot normalize rounded corners across platforms, use the prefixed -webkit-border-radius property instead, which is still

CSS Reset, default styles for common elements

微笑、不失礼 提交于 2019-11-26 19:22:08
问题 After applying a CSS reset, I want to get back to 'normal' behavior for html elements like: p, h1..h6, strong, ul and li. Now when I say normal I mean e.g. the p element adds spacing or a carriage return like result when used, or the size of the font and boldness for a h1 tag, along with the spacing. I realize it is totally up to me how I want to set the style, but I want to get back to normal behavior for some of the more common elements (at least as a starting point that I can tweak later