Microsoft Technology, .Net, BizTalk, Sharepoint & etc.

Liedong(Ken) Zheng, Senior SharePoint Developer at SIMPLOT

Posts Tagged ‘CSS’

CSS Inheritance

Posted by ken zheng on June 26, 2008

we can assign multiple class names to a single element? That means we can change the style sheet so it looks like this:

.boxOut {
  width: 12em;
  padding: 0.5em;
  margin: 0.5em;
  border: solid 1px black;
}

.oddBoxOut {
  float: left;
}

.evenBoxOut {
  float: right;
}

And then the HTML will look like:

<div class="boxOut oddBoxOut">

Grouping Selectors

A single style may have multiple selectors assigned to it through the use of grouping.

To revisit the previous example, we first simplify the HTML so we only mention the one class:

<div class="oddBoxOut">

Then we assign the CSS we want to it, but we group the common property/value pairs.

.oddBoxOut,
.evenBoxOut {
  width: 12em;
  padding: 0.5em;
  margin: 0.5em;
  border: solid 1px black;
}

.oddBoxOut {
  float: left;
}

.evenBoxOut {
  float: right;
}

These two techniques should solve most problems which people think can be solved with OO-style inheritance

Posted in .Net | Tagged: | Leave a Comment »

CSS Stylizer

Posted by ken zheng on June 25, 2008

Been playing with this http://www.skybound.ca/stylizer/ CSS editor lately, and it has some really nice features:

It has a drop down to indicate only certain style elements appear in certain browser flavours:

That’s pretty cool. I just use a bookmark for that at the moment (http://www.noupe.com/better-design/7-css-hacks-you-cannt-live-without.html) but IDE integration would rock.

Posted in Uncategorized | Tagged: | 1 Comment »

Ajax Calendar doesn’t render properly

Posted by ken zheng on May 22, 2008

If your Calendar Extender doesn’t render properly, normally because its’ style has been overriden by the css. As Calendar heavily use DIV, TABLE. To recover this just wrap your textbox and calendar in <DIV class=”calendarContainer “>

and put the following lines in your css:

.calendarContainer table

{
width:0px;

height:0px;
}

.calendarContainer table tr td

{
padding:0;
margin:0;
}

And check your css file doesn’t include

div
{
    min-height: 0;
}

it will set haslayout = true, and you have no way to set to false later.

Look http://www.satzansatz.de/cssd/onhavinglayout.html for more details

Posted in .Net, VS2008 | Tagged: , | 1 Comment »