如何使宽度具有响应性?

How can I adjust the width of Discourse so it is responsive and uses the full width on a wide screen monitor? I do not necessarily need a completely new theme; rather I simply want the equivalent of setting CSS width to 100%.

In this case you should use media query. You can see the CSS on this topic as example "That page doesn't exist or is private" restyling with CSS

Thanks for the reply

I apologize if this is very basic - is there a source somewhere with basic CSS examples?

In this case the CSS below is apparently invalid - where and how would I set max-width to be 100% for the whole site?

The CSS is invalid because there is no target for your rule.

What you can do is search this site and see what other users have changed before you. However, what you want to do is not so simple.

You can try to learn the basics of css through some site like CSS Tutorial or you can hire someone by writing a new topic on marketplace describing well the result you want to achieve.

ok - thank you - will do

Just be aware that using full width on desktops is a bad idea:

https://baymard.com/blog/line-length-readability

Here is how it looks on a 4k Monitor:

Thanks Rafael.

In general, I agree with you.

But it depends on the content.

My workstation has six 4K monitors - which are very helpful for immediate access to details as I read/write, if the information is organized in a readable way. For example, when scrolling through a large set of academic abstracts, it can be more efficient to use the whole screen and thus increase the amount of usable information displayed.

My current project will be to use Discourse to discuss information of this nature. While it may be that not everyone will want to do so in 4K format, it is nice if the software can adapt and show the same information in varying window widths that respond to the reader’s preference.

For example, this is the same information shown in two varying window sizes with responsive software:

That said, can I ask how you adjusted Discourse to show content so wide?

RIght now if I enlarge a window to full size this is all I get:

You can force a full responsive mode by setting your User Agent to a mobile one. I did it using the responsive tools in Firefox Devtools, but any user agent changer will work.

You can also append a query string like https://meta.discourse.org/?mobile_view=1 (Open this in a new tab)

Ahah!

Stupendous - huge thanks

I see that I can also set the responsive mode on or off with /?mobile_view=1 vs /?mobile_view=0 so I can implement that into the menus on my site and give users different options or I can force responsive view on only for sections I know will benefit from it

Huge thanks!

移动端视图的一个问题是,它简化了其他元素,例如:现在你必须打开下拉菜单才能访问分类链接,无法放大回复表单,而且没有实时预览。

不过除此之外,对于某些确实需要它的人来说,看起来已经足够好了。:grinning:

我还看到一个建议,在旧主题中为 .wrap 设置 max-width(例如 100%),链接如下:https://meta.discourse.org/t/how-to-make-my-forum-view-wider/33126。但显然这已不再有效,它只是将消息向左移动,而保持原有大小不变。

不过问题不在于分辨率,而在于屏幕尺寸(例如,有些 15 英寸笔记本是 4K 分辨率,必须使用缩放才能正常使用)。