如何使一个asp.net下拉列表响应 [英] How to make a asp.net drop down list responsive

查看:86
本文介绍了如何使一个asp.net下拉列表响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我怎么会做一个asp.net下拉列表响应。而我的意思是,当我为我的智能手机将格式化其宽度以适应屏幕,当我是在平板电脑上它会做同样的等等。

I was wondering how would I make a asp.net drop down list responsive. And by that I mean when I am on my smart phone it will format its width to fit the screen, and when i am on a tablet it would do the same and so on.

任何例子将是巨大的。

Any examples would be great.

感谢您的帮助。

推荐答案

您将需要添加一个CSS类的下拉列表控件开始(以下简称控制)。这可以通过添加一个或多个类,以在控制所述的CssClass属性来完成。此外,你应该看一看条件CSS语句。

Step 1: Add one or more CSS classes

You'll need to start by adding a CSS class to the dropdown list control (hereafter referred to as 'the control'). This can be done by adding one or more classes to the CssClass attribute in the control. Additionally you should take a look at conditional CSS statements.

有一个基本的响应式设计风格是这样的

A basic responsive design style is something like this

.responsiveWidth{width:100%;max-width:950px;min-width:650px;}


请注意以下事项...

请记住,使用MAX-和最小宽度时,预计如果使用%的宽度,那么你应该使用一个明确的宽度最大宽度最小宽度。这是双向的,所以你可以这样做:


Things to remember...

Just remember that when using max- and min-width, it is expected that if you use a percent for width , then you should use an explicit width for max-width and min-width. This goes both ways, so you could do:

.reponsiveWidth{width:900px;max-width:100%;}

...这将保持在控制宽度900px除非屏幕宽度​​低于900px。

...which would keep the control at 900px width unless the screen width drops below 900px.

下面是一些链接,我在我的响应式设计的文件夹在我的书签...

Here are some links that I have in my "Responsive Design" folder in my bookmarks...

提示

  • 7 Responsive Design Tips to Enhance Your Workflow
  • How to use conditional CSS statements
  • 5 Useful CSS Tricks for Responsive Design

参考

  • W3C CSS Conditional Rules Module Level 3
  • Advanced Conditional Statements

这篇关于如何使一个asp.net下拉列表响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆