asp.net改变.page宽度

时间:2012-06-19 16:18:42

标签: c# asp.net css width

如何在页面后面的代码中以编程方式更改下面的.page宽度值?

我需要根据页面上其他元素的宽度进行设置,这些元素会根据用户操作不断变化。

        .page
        {
            width: 1900px;
            margin: 0px auto 0px auto;
            position:fixed;
        }

如何从c#代码改变它,它的语法是什么?

1 个答案:

答案 0 :(得分:0)

如果你想使用jQuery -

,可以使用jQuery
<script type="text/javascript">
  $(document).ready(function() {
    $('.page').css('width', $('.otherElementClass').width()+'px');
  });
</script>