I have a code:
button {
background: rgb(1, 81, 227);
background: linear-gradient(
90deg,
rgba(1, 81, 227, 1) 35%,
rgba(0, 90, 255, 1) 100%
);
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 20px;
margin: 4px 2px;
cursor: pointer;
border-radius: 6px;
}
And a ton of buttons. I want to apply that css code for all buttons except two, with the IDs startAction & endAction.
How do I do that?
button:not(#startAction):not(#endAction)
by #underscore_d
Your startAction and endAction buttons probably share some of those styles.
If so, just keep those shared lines within the generic button declaration and move the other stuff into a new style and then apply that to the rest of the buttons.
Something like...
button {
display: inline-block;
border: none;
color: white;
...
}
.fancybutton {
background: rgb(1, 81, 227);
background: linear-gradient(
90deg,
rgba(1, 81, 227, 1) 35%,
rgba(0, 90, 255, 1) 100%
);
margin: 4px 2px;
...
}
Related
I am using a custom CSS for a Qt5 window, but there is an ugly horizontal line on the selected button that I would like to get rid of it, or customize it.
This is the CSS I'm using right now.
* {
background-color: black;
color: white;
font: 24px;
}
QPushButton:disabled {
background-color: rgb(67, 67, 67);
border-color: rgb(67, 67, 67);
}
QPushButton {
color: black;
background-color: yellow;
border-width: 1px;
border-color: yellow;
border-style: solid;
border-radius: 10px;
min-width: 3em;
min-height: 30px;
padding: 6px;
}
QPushButton:pressed {
background-color: rgb(255, 193, 0);
border-color: rgb(255, 193, 0);
}
QPushButton:hover {
border-color: rgb(255, 193, 0);
}
QPushButton:default {
background-color: rgb(255, 255, 255);
}
I have created this interface:
My Question is: HOW TO GET RID OF THAT OBSOLETE LINE using my stylesheet.
The black frame (objectname= mainTabBarWidget(QWidget)) is laid out vertically. It has a Fixed height (38px) and contains these elements from left to right: QToolButton, QTabBar, QToolButton, and another QToolButton.
Its stylesheet is the following:
QWidget#mainTabBarWidget {
border-bottom: 1px solid black;
background-color: rgb(107, 102, 102);
}
The "+" QToolButton creates a new Tab whenever its clicked. The QTabBar (called tabBar) has this stylesheet:
QTabBar#tabBar{
left: 10px; /* move to the right by 5px */
border-bottom: none;
}
QTabBar::tab {
background-color: rgb(194, 180, 180);
border-top: 2px solid rgb(107, 102, 102);
border-left: 2px solid rgb(107, 102, 102);
border-right: 2px solid rgb(107, 102, 102);
border-bottom: none;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: -8px;
border-bottom-right-radius: -8px;
min-width: 100px;
max-width: 100px;
height: 35px;
padding: 2px;
}
QTabBar::tab:hover {
background-color: rgb(216, 209, 209);
}
QTabBar::tab:selected {
background-color: rgb(243, 231, 231);
border-color: rgb(0, 0, 0);
}
QTabBar::scroller { /* the width of the scroll buttons */
border: none;
width: 20px;
background-color: rgba(0,0,0,55);
}
QTabBar::tear {
border: none;
background-color: rgba(222,221,15, 45);
width: 0px;
}
QTabBar::tab:disabled {
border: none;
}
P.S.1. When 3 or 4 tabs are added, the line disappears too.
P.S.2. I tried setting the tab width to 120px and the line disappeared, but when I add other tabs and the scroll buttons show up, this line re-appears.
I had a similar problem, but it was solved below.
http://doc.qt.io/qt-5/qtabbar.html#drawBase-prop
QTabBar::setDrawBase(false);
for a project I'm working on I use a worldmap image, and centered this image.
the idea is that if you go over a certain country a tool tip message will come up below it and tell you the name of the country.
the popup box is build in css.
for example:
span.Amerika:hover:after {
content: "Amerika";
position: absolute;
width: 80px; /* box size */
height: 20px; /* box size */
padding: 10px;
font-size: 14px;
font-weight: bold;
text-align: center;
color: rgb(113, 157, 171);
background: rgb(255, 255, 255);
border: 4px solid rgb(255, 255, 255);
border-radius: 5px;
text-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 1px;
box-shadow: rgba(0, 0, 0, 0.0980392) 1px 1px 2px 0px;
top: 320px; /* positioning */
left: 320px; /* positioning */
}
you could have guessed the positioning only works on my screen. on all larger screens the boxes will appear somewhere else.
So I'm thinking about having the tool tip message hover with the cursor. (follow the cursor)
how would i do this?
In normal web browser looks like following
I have overwritten the bootstrap's following rules in a different file code is given bellow
body {
margin-left: 8px;
margin-right:8px;
}
div .span8 {
border: 2px solid rgb(121, 25, 77);
border-radius: 10px 10px 10px;
background-color: rgb(188, 187, 178);
}
div .span2 {
border: 2px solid rgb(163, 43, 70);
border-radius: 10px 10px 10px;
background-color: rgb(240, 225, 200);
}
.navbar-inner {
background-image: linear-gradient(to bottom, #04998D, #f2f2f2);
}
.navbar .nav > li > a {
color: #D33333;
text-shadow: 0 1px 0 #19B95F;
}
.navbar .nav li.dropdown.open >
.dropdown-toggle, .navbar .nav li.dropdown.active >
.dropdown-toggle, .navbar .nav li.dropdown.open.active >
.dropdown-toggle {
color: #555555;
background-color: #83C0AF;
}
.dropdown-menu {
background-color: #64bead;
background-image: linear-gradient(to bottom, #04998D, #f2f2f2);
}
My problem is when I browse it from any mobile device, I see no change in navbar-inner. Others are changed. I know that, I have to change in bootstrap-responsive.css file. But I have no idea how I will change it.
I want my nabar like following in mobile.
But navbar color is white as was before.
So, How can I change in media query.
For customizing bootstrap refer to Customizing Bootstrap documentation. Look at Customizing components sub section.
So in you case you should override .navbar-inner in css which is loaded after bootstrap.css.
To change color scheme you could also:
use customizer
download less source and modify variables.
By doing so you change color at all places, so you dont have to search for specific color through entire css and replace it with new one.
From the discussion with Sentencio, I found my mistake. Now I am going to tell how I solved it.
I changed the all background-image properties with -webkit-gradient, -webkit-linear-gradient, -moz-linear-gradient and linear-gradient. Code given bellow
.navbar-inner {
min-height: 40px;
padding-right: 20px;
padding-left: 20px;
background-color: #fafafa;
background-image: -moz-linear-gradient(top, #04998D, #f2f2f2);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#04998D), to(#f2f2f2));
background-image: -webkit-linear-gradient(top, #04998D, #f2f2f2);
background-image: -o-linear-gradient(top, #04998D, #f2f2f2);
background-image: linear-gradient(to bottom, #04998D, #f2f2f2);
background-repeat: repeat-x;
border: 1px solid #d4d4d4;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);
*zoom: 1;
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
}
I want to position my navigation inline, but without space between the buttons. You can suggest some tip how to position them in the middle of the page as well. I have tried with margin:0, padding-left:0px but there are still space between them. Here is the html code:
<div id="nav">
<nav role="navigation">
<ul>
<li><a href="./" class="button" title="Go to the home page"</title>Home</a></li>
<li>About</li>
<li>Contact</li>
</ul></nav></div>
And CSS style:
.button{
color: rgb(0, 0, 0);
font-size: 15px;
padding: 11px;
text-shadow: 0px 2px 2px rgba(144,150,150,0.75);
background: rgb(255, 255, 248);
background: -moz-linear-gradient(90deg, rgb(255, 255, 248) 69%, rgb(56, 2, 137) 92%);
background: -webkit-linear-gradient(90deg, rgb(255, 255, 248) 69%, rgb(56, 2, 137) 92%);
background: -o-linear-gradient(90deg, rgb(255, 255, 248) 69%, rgb(56, 2, 137) 92%);
background: -ms-linear-gradient(90deg, rgb(255, 255, 248) 69%, rgb(56, 2, 137) 92%);
background: linear-gradient(0deg, rgb(255, 255, 248) 69%, rgb(56, 2, 137) 92%);
-webkit-box-shadow: 0px 2px 1px rgba(50, 50, 50, 0.73);
-moz-box-shadow: 0px 2px 1px rgba(50, 50, 50, 0.73);
box-shadow: 0px 2px 1px rgba(50, 50, 50, 0.73);
}
#nav li{
display:inline;
}
#nav ul{
list-style-type:none;
margin:0;
}
#nav ul li a{text-decoration:none;
font:Tahoma, Helvetica, Arial, sans-serif;
letter-spacing:0.1em;
}
First to center your nav into the middle of the screen use bellow.
#nav{
width:960px; -- change me to correct size
margin-right:auto;
margin-left:auto;
height:110px; -- change me!
}
As for list this will take list and line it up from left to right. The only gap between links should be the little padding so it doesn't look on top of each other.
#nav ul {
display: inline;
list-style: none outside none;
margin: 0;
padding: 0;
}
#nav li {
display: inline;
font-size: 11px;
padding-right: 2px;
padding-left: 2px;
width: 100px; -- this depends on the number of buttons you have of course.
}
Hope this helps!
On your #nav li, use display: block and float: left instead, like this:
#nav li {
display: block;
float: left;
}
See DEMO.
if you want to display it inline without and blank space, try to use letter-spacing or word-spacing with negative value