MyBB Community Forums

Full Version: How to change the width in global.css file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So this is the code for the DVZ shoutbox and I want to change the width to make the rectangular box a square.

What to change to the bellow stylesheet to make it a square box instead of rectangle. 

[Image: e3c7984c95e968afebeb25f580d7be40.png]

/* DVZ Shoutbox */
#shoutbox { margin-bottom: 10px; border: solid 2px rgba(0,0,0,0.1); }
#shoutbox .head { padding: 8px; }
#shoutbox.front .head { cursor: pointer; }
#shoutbox .head .right { float: right; margin: 10 -8px 0 0; font-size: 13px; }
#shoutbox .head .right a { padding: 8px; }
#shoutbox.collapsed .head { opacity: 0.6; }
#shoutbox.collapsed .body { display: none; }

#shoutbox .panel { border-top: solid 2px rgba(0,0,0,0.1); }
#shoutbox input.text { margin: 0; padding: 10px 8px; width: 30%; box-sizing: border-box; border: none; box-shadow: inset 0 2px 4px rgba(0,0,0,0.08); font-family: Arial, sans-serif; font-size: 12px; color: #000; }
#shoutbox .minposts, #shoutbox .blocked { padding: 6px; font-size: 11px; }
#shoutbox .panel.minposts { background: #FFFED8; color: #727250; }
#shoutbox .panel.blocked { background: #FCEFEF; color: #543A3A; }
#shoutbox .panel p { margin: 0; }

#shoutbox .window { border-top: solid 2px rgba(0,0,0,0.1); overflow-y: scroll; }
#shoutbox .data { display: table; width: 30%; border-top: solid 2px rgba(0,0,0,0.1); font-family: Arial, sans-serif; font-size: 12px; }
#shoutbox.front .data { border-top: none; }

#shoutbox .entry { display: table-row !important; width: 30%; transition: background-color 0.2s; }
#shoutbox .entry:nth-child(even) { background-color: rgba(0,0,0,0.01); }
#shoutbox .entry.new { background-color: rgba(255,255,100,0.1); }
#shoutbox .entry:target { background-color: rgba(50,200,255,0.1); }
#shoutbox .entry > div { border-bottom: dashed 1px rgba(0,0,0,0.05); }
#shoutbox .entry:last-child > div { border-bottom: none; }

#shoutbox .entry > div { display: table-cell; padding: 6px; }

#shoutbox .avatar { height: 22px; }
#shoutbox .avatar img { margin: 0 auto; vertical-align: middle; max-height: 20px; max-width: 20px; border: solid 1px rgba(255,255,255,0.1); box-shadow: 0 0 2px rgba(0,0,0,0.1); cursor: pointer; }
#shoutbox .user { border-right: solid 1px rgba(0,0,0,0.05); text-align: right; white-space: nowrap; }
#shoutbox .text { width: 100%; color: #555; word-break: break-all; word-wrap: break-word; }
#shoutbox .info { font-size: 11px; color: #AAA; white-space: nowrap; text-align: right; }
#shoutbox .entry.unread .info:before { display: inline-block; margin-right: 10px; height: 4px; width: 4px; content: ''; background: rgba(255,100,0,0.8); border-radius: 10px; vertical-align: middle; }
#shoutbox .info a { color: inherit; }
#shoutbox .mod { padding: 6px 8px; font-size: 9px; font-weight: bold; color: #AAA; text-decoration: none; }
#shoutbox .mod:nth-of-type(2) { margin-right: 5px; border-left: solid 1px rgba(0,0,0,0.1); }
#shoutbox  .ip { margin-right: 10px; color: #CECECE; }

I also have this template file dvz_shoutbox, do I need to change this to edit the width?

<div id="shoutbox" class="front{$classes}">

<div class="head">
<strong>{$lang->dvz_sb_shoutbox}</strong>
<p class="right"><a href="{$mybb->settings['bburl']}/index.php?action=shoutbox_archive">&laquo; {$lang->dvz_sb_archivelink}</a></p>
</div>

<div class="body">

{$panel}

<div class="window" style="height:{$mybb->settings['dvz_sb_height']}px">
<div class="data">
{$html}
</div>
</div>

</div>

<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/dvz_shoutbox.js"></script>
{$javascript}

</div>

Edit was able to fix it, added a style=width:1000px
If you're using a responsive theme, better use a relative width ([r]em or %) rather than px. A fixed width can break your design on smaller screens.
When you want to keep staying with pixels, then use max-width: 1000px

[ETS]
(2022-11-24, 11:12 AM)[ExiTuS] Wrote: [ -> ]If you're using a responsive theme, better use a relative width ([r]em or %) rather than px. A fixed width can break your design on smaller screens.
When you want to keep staying with pixels, then use max-width: 1000px

[ETS]

Thanks it works. But the problem now is, it shows different size depending on different browsers and different monitor size, meaning small screen has big width and large screen has small width, any other way to fix the width.
Okay fixed it, just set it to auto-adjust and it does the work.