【发布时间】:2020-03-05 23:10:54
【问题描述】:
我需要帮助 :) 有我的电子应用程序的屏幕截图。我在标题栏上工作,但我想将标题居中,我该怎么做,谢谢你们!由于我是初学者,我不知道这种做标题栏的方法是否好,你能说这好不好? (如果我能滥用你的好意,我怎么能用“valider”做双按钮,这对我以后有用。
再次非常感谢您!
HTML:
<div id="title-bar">
<button id="close-btn" class="tb-buttons">
<img src="Images/Close.png" />
</button>
<p id="title">CharactersPalette</p>
<button id="eye-btn" class="tb-buttons">
<img src="Images/Hide.png" />
</button>
<button id="min-btn" class="tb-buttons">
<img src="Images/Min.png" />
</button>
</div>
CSS:
/* ~~~~~~~~~~~~~ TitleBar ~~~~~~~~~~~~ */
* {
margin: 0px;
padding: 0px;
border: 0px;
-webkit-user-select: none;
-webkit-app-region: no-drag;
}
#title-bar {
width: 100%;
height: 30px;
-webkit-app-region: drag;
background-color: #21252b;
}
#title-bar > button {
height: 30px;
width: 34px;
display: inline-block;
background: transparent;
outline: none;
transition: 0.15s linear;
}
#title-bar > button:hover {
background-color: #d52015;
}
#title-bar > #title {
display: inline-block;
color: #f8f4f4;
}
#title-bar > #eye-btn,
#title-bar > #min-btn {
height: 30px;
width: 34px;
display: inline-block;
background: transparent;
float: right;
transition: 0.15s linear;
}
#title-bar > #eye-btn:hover,
#title-bar > #min-btn:hover {
background-color: #3e4146;
}
#title-bar > button > img {
height: 18px;
width: 18px;
vertical-align: middle;
}
【问题讨论】: