Is Float Really Missing in HtmlTextWriterStyle?

Is there really no float in HtmlTextWriterStyle?

I rarely use

Control.Style.Add(HtmlTextWriterStyle.Whatever, "myval"); 

to set styles for elements, but sometimes I have to create a dynamic element from the code, and I will use the style with this method to check some style.

Today I tried to install

 float:left; 

and was rather stunned by the fact that it does not have a float property. I could not find much on Google besides this short problem log: Microsoft Connect Error Log .

So my question is: is it really missing and why?

EDIT

So, I got @Thomas Levesque's answer and found that HtmlTextWriterStyle was introduced on April 3, 2003 in .Net 1.1 . This was the time when IE 6 was the last and greatest that MS could offer. It is possible that due to their crappy standards, they still relied on tabular layouts.

I have no evidence that this is true , but this is my favorite answer.

+4
source share
1 answer

You can use another overload Add :

 control.Style.Add("float", "left"); 

But it’s really strange that this is not in the HtmlTextWriterStyle enumeration ... perhaps because Internet Explorer could not display it correctly while creating this enumeration;)

+10
source

All Articles