Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Less TwitterBootstrap+;mvc,如何将动态宽度传递给boostrap。更少的类_Less - Fatal编程技术网

Less TwitterBootstrap+;mvc,如何将动态宽度传递给boostrap。更少的类

Less TwitterBootstrap+;mvc,如何将动态宽度传递给boostrap。更少的类,less,Less,我正在使用TwitterBootstrap,我想传递按钮宽度动态..如下代码 我想从客户端(从视图(MVC))动态地传递“@wth”值。 现在它在变量上以静态的方式出现。更少的文件…但是我想直接从视图(MVC)传递 那么,最好的解决方案是什么 尽管在浏览器中使用较少的.js会给人一种能够做动态事情的印象,但这些样式都被编译成CSS文件,并且在应用到html时具有固定值。因此页面加载后,您无法更改较少变量的值 如果您需要根据一些预设的大小动态地更改按钮的宽度,我建议您应该向css中添加类(小

我正在使用TwitterBootstrap,我想传递按钮宽度动态..如下代码

我想从客户端(从视图(MVC))动态地传递“@wth”。 现在它在变量上以静态的方式出现。更少的文件…但是我想直接从视图(MVC)传递

那么,最好的解决方案是什么


尽管在浏览器中使用较少的.js会给人一种能够做动态事情的印象,但这些样式都被编译成CSS文件,并且在应用到html时具有固定值。因此页面加载后,您无法更改较少变量的值

如果您需要根据一些预设的大小动态地更改按钮的宽度,我建议您应该向css中添加类(小、中、大等),然后通过Jquery的方法将该类动态地添加到css中

如果需要直接设置宽度,我将使用Jquery的方法


如果你打算做很多这类事情,你可能想研究使用一个数据绑定库,它可以将Javascript对象绑定到你的html样式,比如。

我很好奇-为什么你可以粘贴代码却要粘贴代码的图像?通常我不使用堆栈…所以,我没有太多的想法和意识的代码的加分比图像..嗨,兄弟,thx的答复…我熟悉敲除+jquery。但我想用“TwitterBootstrap”做些新东西。那么,你知道我如何制作或提供链接或代码吗?…这对我应该有帮助。Bootstrap网站上有很多很好的Exmaple:我知道…我正在使用Bootstrap…但我的问题是。。。“我可以传递CSS值动态吗?”…请再次查看我的问题…正如我在回答中所述,在页面加载后,您不能更改这些变量的值。LESS不打算以这种方式使用。