Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Tuesday, November 25, 2008

Html Fieldset Rounded Corners - Updated (1/18/2010)

I don't usually prefer anything about Internet Explorer. However, IE's default presentation for the Html fieldset tag just looks nicer. Firefox, on the otherhand, defaults to an ugly square box presentation. So, to try to get Firefox to look more like IE (something I never thought that I would say) ...

fieldset { 
   -moz-border-radius-bottomleft: 7px;
   -moz-border-radius-bottomright: 7px;
   -moz-border-radius-topleft: 5px;
   -moz-border-radius-topright: 7px;
   -webkit-border-radius: 7px;
   border-radius: 3px;
}
This works for IE, Firefox, and now Chrome. It still doesn't look "nice" in Safari.

If you absolutely must have rounded corners: http://www.spiffycorners.com. However, I caution you against the author's approach because it requires too much Html for an effect that will be cleanly implemented in CSS3. Again, this is only a nice to have.

Example:

Title contents

Wednesday, November 05, 2008

ASP.Net - Dynamically Adding a CSS/StyleSheet Reference at run-time

Per Michael, I have removed a technique that was only available in Beta 1.

protected void Page_Init(object sender, EventArgs e)
{
   HtmlLink link = new HtmlLink();
   link.Href = "~/StyleSheet.css";
   link.Attributes.Add("rel", "stylesheet");
   link.Attributes.Add("type", "text/css");
   Page.Header.Controls.Add(link);
}

Tuesday, October 07, 2008

Print.css

Recently, I ran into a case where a user's printout of an order confirmation was cropping a portion along the rights side of the page.

By default, almost all browers print in "Scale-to-Fit" mode.  This particular user happened to be using Print at "100%".

Changed our html/aspx page to the following...

Html

<head id="head" runat="server">
   <link href="/shared/css/style.css" type="text/css" rel="stylesheet">
   <link href="/shared/css/print.css" type="text/css" rel="stylesheet" media="print">
<head>

CSS

body
{
background: white;
margin: 0;
font-size: 0.75em;
width: 660px;
}

#PageContainer
{
width:640px;
}

a:link, a:visited
{
color: #520;
background: transparent;
font-weight: bold;
text-decoration: underline;
}

Tuesday, October 24, 2006

CSS and Html Resources