by kevin
16.
十二月 2013 14:15
>
最近在改版65emall的时候,碰到一个很棘手的问题,Chrome浏览器有个最小字号设置,就是当字号小于最小字号时,就会自动调整为自动调整为最小的字号。如下图: 在中文版的Chrome中,默认的最小字号是12; 在英文版的Chrome中,默认的最小字号是10。 1: -webkit-text-size-adjust:none;
网上很多都建议使用上面这样的语法来实现,但在高版本的Chrome中,这个语法已经无效了。
所以使用 -webkit-transform:
代码如下:
1: .font-size8 { font-size: 8px;}
2: .font-size9 {font-size: 9px;}
3: .font-size10 {font-...
[更多...]
by kevin
8.
十一月 2013 13:40
>
做为一个非专业的Css编写人员,一不小心,就可以踩到坑。 觉得小于12号的字不利于阅读,所以google chrome小于12号的字,都会被修正为12号。 google了下,据说,随着浏览器版本的升级,处理的方案还不一样。 整体的代码如下: 1: * {
2: -webkit-text-size-adjust: none;
3: -webkit-transform-origin-x: 0;
4: -webkit-transform: scale(0.8333333333333334); /* 10/12=0.8333333333333334) */
5: }
by kevin
22.
十月 2013 13:58
>
要实现my cart那样的边框效果,很自然的想到 上面一个div, 下面一个div, 上面那个div的z-index比下面的这个大, 下面这个div往上移1px。 然后,悲剧就开始了。。。 总结了一下,基本上是以下几个坑: z-index 仅能在定位元素上奏效,就是要求该元素设置 position:xxxx,否则z-index无效。 如果元素内嵌于li,那么li需要设置 position:relative 上面的div需要设置background,否则无法遮住下面的div 主要代码如下: 1: <li style="position:relative" id="cart" >
2: <div style="width:...
[更多...]
by kevin
9.
十月 2013 22:13
>
囧:闭着嘴,这是基本囧。 冏:开口之后,依然很囧。 烱:发火是囧。 浻:吐口水还是囧。 埛:长成这样,当然是屌丝囧。 綗:不止屌丝,其实白富美也会囧。
by kevin
27.
九月 2013 13:46
>
FluentData是一个微型的ORM框架,使用可以很容易的对数据库进行数据操作。前段时间,花了点时间,对FluentData3.0的使用手册做了翻译,求点评。 FluentData入门(一)--核心概念 FluentData入门(二)--创建DbContext FluentData入门(三)—Query FluentData入门(四)—Mapping FluentData入门(五)—Insert, Update, Delete FluentData入门(六)--存储过程和事务
by kevin
23.
九月 2013 13:44
>
存储过程 使用SQL语句: 1: var rowsAffected = Context.Sql("ProductUpdate")
2: .CommandType(DbCommandTypes.StoredProcedure)
3: .Parameter("ProductId", 1)
4: .Parameter("Name", "The Warren Buffet Way")
5: .Execute();
使用builder:
1: va...
[更多...]
by kevin
17.
九月 2013 13:26
>
插入数据 使用 SQL 语句: 1: int productId = Context.Sql(@"insert into Product(Name, CategoryId)
2: values(@0, @1);")
3: .Parameters("The Warren Buffet Way", 1)
4: .ExecuteReturnLastId<int>();
使用builder:
1: int productId = Context.Insert("Product")
2:...
[更多...]
by kevin
13.
九月 2013 17:55
>
映射 自动映射 – 在数据库对象和.Net object自动进行1:1匹配 1: List<Product> products = Context.Sql(@"select *
2: from Product")
3: .QueryMany<Product>();
自动映射到一个自定义的Collection:
1: ProductionCollection products = Context.Sql("select * from Product").QueryMany<Product, ProductionCollection&...
[更多...]
by kevin
13.
九月 2013 16:08
>
查询一组数据 返回一组dynamic对象(new in .NET 4.0) 1: List<dynamic> products = Context.Sql("select * from Product").QueryMany<dynamic>();
返回一组强类型对象
1: List<Product> products = Context.Sql("select * from Product").QueryMany<Product>();
返回一个自定义的Collection
1: ProductionCollection products = Context.Sql("...
[更多...]
by kevin
7.
九月 2013 13:58
>
如何创建和初始化一个DbContext 可以在*.config文件中配置connection string,将connection string name或者将整个connection string 作为参数传递给DbContext来创建DbContext。 重要配置 IgnoreIfAutoMapFails – IDbContext.IgnoreIfAutoMapFails返回一个IDbContext,该实例中,如果自动映射失败时是否抛出异常 通过*.config中配置的ConnectionStringName创建一个DbContext 1: public IDbContext Context()
2: {
3: return new DbContext().ConnectionStringNam...
[更多...]