gpt4 book ai didi

css - 当浏览器大小/屏幕分辨率发生变化时,如何使 div/section 灵活?

转载 作者:太空宇宙 更新时间:2023-11-04 04:21:52 28 4
gpt4 key购买 nike

我的系统的 GUI 在 1366 X 768 分辨率下运行良好。当它以不同的分辨率显示时,我需要并排滚动,而它不应该这样。此外,当我尝试在 chrome 中按 ctr+- 时,div 和部分变得困惑。

<header>
<h1><font color = "#666" face="Arial Black" size="5%">&nbsp;&nbsp;&nbsp;Isplika:</font> A Web-based IDE for C++ Source Content for Programming Beginners
<span id = "strength" > Our Stength, Our God Ü </span>
</h1>
</header>

<div id = "wrapper">

<section id = "board">

<section id = "board_c">
<div id = "board_ln"> </div>
<div id = "board_code_w">
<div id = "tags_c" class = "tags">C++ Code</div>
<div id = "board_code" contenteditable = "true" ></div>
<div id = "board_code_dup" contenteditable = "false"></div>
</div>
</section>

<section id = "board_mb">
</section>

<section id = "board_code_info">

Row:
<section id = "row" class="tab_space_right">
1
</section>

Col:
<section id = "col" class="tab_space_right">
2
</section>

Number of Lines:
<section id = "numLines" class="tab_space_right">
3
</section>

</section>
</section>

<section id = "interpreter">
<div id = "tags_int" class = "tags">Result</div>
<section id = "interpreter_c">
</section>
<section id = "interpreter_input">
<input id = "inputF" type = "text" />
</section>
<div id = "inputB" class="buttons">
INPUT
</div>
</section>

<section id = "identifier">

<div id = "tags_iden" class = "tags">Variables</div>

<section id = "identifier_type">

</section>

<section id = "identifier_name" >

</section>

<section id = "identifier_value">

</section>
</section>

<section id = "controls">
<div id = "run" class = "buttons" >RUN</div>
<div id = "stop" class = "buttons" >STOP</div>
<div id = "next" class = "buttons" >NEXT</div>
<div id = "support" class = "buttons" >SUPPORT</div>
</section>
</div>

</body>
</html>

enter image description here

#board 应该是可调整大小的,但是 #interpreter#identifier 应该是静态的

最佳答案

你可以用javascript(jquery)轻松解决。

jQuery(document).ready(function($) {

function resizeBoard(){
$('#board').css(width, ($(window).width() - $(#interpreter).width());
}
resizeBoard();

$(window).resize(function() {
resizeBoard();
});
});

我还将它放在一个调整大小的函数中,这样每次你调整屏幕大小时它都会被执行。

问候提摩太

关于css - 当浏览器大小/屏幕分辨率发生变化时,如何使 div/section 灵活?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18921174/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com