Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Friday, August 03, 2007

CSS: Irritating IE FORM tags act like BR tag

One of the irritating things about IE is that the form start tag is automatically treated like a line-break tag.

Add this to your stylesheet to solve the problem:
form {margin: 0px 0px 0px 0px; }


source(s): http://weblogs.macromedia.com/cantrell/archives/2003/05/
git_rid_of_anno.cfm

Thursday, December 07, 2006

CSS: Block IE 'active content' bar

I don't know what implications this has, the IE 'warning active content' bar pops up on safe CSS using ActiveX, but the message may be coming up legitimately.

Problem: I wanted to have a fancy gradient in the background of a button for IE users only. I found css code supposedly uses activeX to achieve this.
CSS code:
.btn { filter:progid:DXImageTransform.Microsoft.Gradient(
GradientType=0,StartColorStr='#ffD3D7E0',EndColorStr='#ff8C939B');}


But when I view the HTML page on my local computer I see:
"To help protect you security, Internet Explorer has restricted this file from showing active content that could access your computer"

Solution: I found a forum that said when you deploy it to HTTP this message goes away. Another alternative is to include the following code.

<!-- Start Information Bar Blocking Code -->
<!-- saved from url=(0027)http://www.blockingspoof.com/dumbie.html -->
<!-- End Information Bar Blocking Code -->


However I noticed that while the IE-Bar goes away, I don't think it addresses this issue: (an IE security flaw which I also found) which leads me to think the IE Bar is legitimately popping up (because of insecure code).
see: http://osvdb.org/27109

Monday, October 24, 2005

CSS: Force a Fixed Width HTML Webpage

Cross-browser content layout fix for variable-length content using CSS

BACKGROUND:
Firefox browser page has no vertical scrollbar unless the content exceeds the browser window height. IE always has a vertical scrollbar, it is merely greyed out when the content doesn't exceed the browser window height.

PROBLEM:
This can be a problem if you have some centered content in pages with the same layout but some content fits in the browser window and on other pages the content is taller than the window. Navigating from one page to the other appears as if the centered content is misaligned.

SOLUTION:
Include this stylesheet in your html code of the webpage to force a scrollbar even when its not necessary, for regular width pages.

<style type="text/css">
html { height: 100.1%; }

</style>

Thursday, September 22, 2005

CSS: Hide blocks of a webpage when printing

When printing a webpage, how do you hide certain elements of the page?

There is no onprint action in Javascript that I am aware of.

The key is to use css:

Note: In css '#' denotes an ID selector, '.' denotes a class selector.
<style type="text/css">
@media print
{
div.headerbox{ display:none; }
}
</style>

<
div class="headerbox">...
hidden when printed</div>
<
div class="otherbox">...
not hidden when printed</div>

or

<style type="text/css">
@media print
{
div#headerbox{ display:none; }
}
</style>

<
div id="headerbox">... hidden when printed</div>
<
div id="otherbox">... not hidden when printed</div>