I have a p-dialog that shows up when the application loads up in app.component.html file as follows.
<div class="banner">
<p-dialog [(visible)]="displayBanner" [modal]="true" [style]="{width: '70vw'}" [baseZIndex]="10000" [showHeader]="false"
[draggable]="false" [resizable]="false">
<banner (notify)="onNotify($event)"></banner>
</p-dialog>
</div>
This displays the application banner. I had to override the background color to black when this dialog shows up. So added css as below.
.p-dialog-mask.p-component-overlay {
background-color: #000;
}
Once the dialog is closed i get the normal primeng display for each page. Within the page there are couple of delete functionalites which has the confirmation code in the corresponding html as below.
<p-confirmDialog header="Confirmation" icon="pi pi-exclamation-triangle"></p-confirmDialog>
this confirmation uses the same css .p-dialog-mask.p-component-overlay , so this in turn turns the background to black. So i tried to remove the css with background color as black by using styleClass : background-color: #000; in p-dialog for banner page as below:
<div class="banner">
<p-dialog [(visible)]="displayBanner" [modal]="true" [style]="{width: '70vw'}" styleClass="bgColorChange" [baseZIndex]="10000" [showHeader]="false"
[draggable]="false" [resizable]="false">
<banner (notify)="onNotify($event)"></banner>
</p-dialog>
</div>
and in css as follows:
.bgColorChange {
background-color: #000;
}
But this is not overwriting the css and it appears normal background. How can i apply 2 different styles for p-dialog? Since the balck background is only in the application banner which shows up on application load i thought i would apply to the p-dialog tag but it doesnt take effect. Any inputs highly appreciated.
Try
p-dialog ::ng-deep .bgColorChange {
background-color: #000;
}
Related
I have created a agm-info-window that has an image and a small text (tittle):
<agm-marker [latitude]="lat3" [longitude]="lng3" [iconUrl]="icon">
<agm-info-window [disableAutoPan]="true" [isOpen]="true">
<div routerLink="/sight/2">
<img src="assets/mesta/tvrdjava.jpg" alt="Image" width="80" height="80"> <br>
<span class="window-title"> Bubanj </span>
</div>
</agm-info-window>
</agm-marker>
This is the result:
I want to change the info window css. - The background color, remove the close button (x) and put the text in the center. Like so:
I get the correct effect when I set the CSS in Chrome's inspector. I set:
/* Remove the X, close button */
.gm-ui-hover-effect {
display: none;
}
.gm-style-iw {
padding: 0;
background-color: #AAAAAA;
text-align: center;
color: white;
}
/* remove overflow scroll */
.gm-style-iw-d {
overflow: none;
}
But when I put this same css in the components css, it doesn't change at all, nothing changes.
I don't have a lot of changes, so I would prefer not to use snazzy info window. I just want these small changes to the window. Is it possible ? Why is the css not working ?
Use this CSS in styles.css as component css is having low priorities
Try to add css in he same page under the div. Maybe there are cinflict b/w that's why it doesn't change anything.
I'm developing a web application using the Vaadin framework.
I have a Button styled as BaseTheme.BUTTON_LINK and have an icon showing.
The button is assigned a CSS class which has a hover state, when the button is hovered the icon is replaced. Simple enough.
However, I find that once the button is clicked, the hover stops working until you click elsewhere. The button seem to be focused after clicking and then the hover effect doesn't work.
Does anyone know a way to work abound this, either using Vaadin or CSS?
EDIT: HTML and CSS added
HTML:
<div style="height: 26px; width: 292px; overflow: hidden; float: left; padding-left: 6px; padding-top: 0px;">
<div style="float: left; margin-left: 0px;">
<div class="v-button v-button-link link v-button-m2m-refreshbutton m2m-refreshbutton" tabindex="0" role="button">
<span class="v-button-wrap">
<img class="v-icon" alt="" src="/M2M/VAADIN/themes/m2m/../m2m/img/refresh_.png">
<span class="v-button-caption"></span>
</span>
</div>
</div>
</div>
CSS:
.m2m-refreshbutton:hover {
background: url("../m2m/img/refresh_hover.png") no-repeat center;
}
I encountered the same problem when I used Vaadin to create Liferay portlet. I was able to fix it by changing the CSS Vaadin uses (by using the CSS Inject Add-on, but it is also possible to just provide a custom Vaadin theme). The piece of CSS that worked for me is:
.v-button:active .v-button-wrap, .v-button.v-pressed .v-button-wrap, .v-button:focus .v-button-wrap {
background: #d4d4d4 url(/html/themes/classic/images/portlet/header_bg.png) repeat-x 0 0 !important}
In general it is a better idea to do this with background-images in CSS only.
You should also use an <a></a> tag for this because older Internet Explorers for example don't apply link states to HTML elements other than <a></a>.
Basically getting different images for the different states of a link can be done like this:
HTML:
<a class="someClass" href="location"></a>
CSS:
.someClass {
background-image: url(path_from_css_file/link.png);
background-repeat: no-repeat;
background-position: top left;
}
.someClass:hover {
background-image: url(path_from_css_file/link_hover.png);
}
.someClass:focus {
background-image: url(path_from_css_file/link_focus.png);
}
.someClass:active {
background-image: url(path_from_css_file/link_active.png);
}
.someClass:visited {
background-image: url(path_from_css_file/link_visited.png);
}
Using javascript it is possible.
first get the button
buttonElement = document.getElementById("yourID");
Add Event listener to the button and call a function.
ButtonElement.addEventListener('click', nofocus);
create the function
function nofocus () {
this.blur();
}
whenever you click the button. focus state will gone.
So it's detailed here on how to remove the padding on buttons by overriding the class on the page: Can the button padding be adjusted in Jquery Mobile?
But how do I take this:
.ui-btn-inner {
padding: 0;}
And selectively apply it to one button, ie:
<button data-icon="false" onclick="alert('clicked me')">Button Name</button>
Doing anything like this doesn't work:
<button style="padding:0" data-icon="false" onclick="alert('clicked me')">Button Name</button>
Thoughts? Creative solutions?
Thanks
Just set a new class for that button and then change subclass as below.
HTML:
<a href"#" data-role="button" class="myClass">Text</a>
CSS:
.myClass .ui-btn-inner{
padding: 0px;
}
I think I have finally found a solution (been trying to figure it out for a while now)!
Use the 'cascading' part of CSS to help you. If your button uses theme 'a' for instance, you can apply the padding rules of .ui-btn-inner to only buttons with theme 'a'. Just prefix the class you are trying to change, with the themed property.
HTML:
<a href"#/mypath" data-role="button" data-theme="a">Touch Me</a>
CSS:
.ui-btn-up-a .ui-btn-inner,
.ui-btn-hover-a .ui-btn-inner,
.ui-btn-down-a .ui-btn-inner
{
padding: 0px;
}
As you can see, this means you have to create the rule for each state of the button, otherwise the padding will return for the split second when you touch the button.
Just apply a different theme (such as 'b') to the buttons that should keep their padding. You can go totally nuts with buttons using this type of CSS inheritance.
You can have an unlimited number of themes. I go to theme roller and create a default theme for every letter of the alphabet. Then, just override them with CSS to my heart's content.
This was a big sticking point when I was trying to use jQuery Mobile for a work project. They already had a UI design and I was tasked with making jQuery Mobile match it exactly.
I just wanted the icon to show with no border or background so I used your example, but the icon was shifted up so I used this to reposition it:
.ui-btn-up-mytheme .ui-btn-inner,
.ui-btn-hover-mytheme .ui-btn-inner,
.ui-btn-down-mytheme .ui-btn-inner {
margin-top: 2px;
border: none;
}
The html markup:
<a href="schedules" data-rel="back" data-icon="arrow-l" data-iconpos="notext"
data-theme="mytheme" data-shadow="false" ></a>
I am developing an ASP.NET web application and I have some images in the images slider without any links, so now when I put the images between anchor tags I got a border (in a purple color) around each image just in the Internet Explorer and I don't know why. In Firefox, everything works fine. So how to fix that in the IE browser?
What slider?
if you want to remove borders from all the images in < a > tags
you can use the following css rule:
a img {
border:none;
}
... every IE sometimes has problems with style="border-style:none"
use style="border:none" instead
Set the border-style property to none.
img { border-style: none; }
This example uses the style attribute to define the border style:
<a href="myurl" style="border: none;">
<img src="someimage.jpg" .... />
</a>
a img {
border: medium none;
}
Hope this helps.
The header and body have the correct background color but the fonts look gray. I am running on DOTNETNUKE version 4.9.0 and 4.9.1 and Windows 2003.
Thanks
test.htm
<body class="border">
<div class="PhilosophyHeader" runat="server">[ACTIONS][ICON] [TITLE]</div>
<div id="ContentPane" runat="server" class="PhilosophyBody"></div>
</body>
container.css
.PhilosophyHeader
{
color: #FF0000;
font: normal normal bold 100%/normal serif;
border: thin #CC9900;
background-color: #CC9900;
}
.PhilosophyBody
{
background-color: #800000;
color: #CC9900;
}
.border
{
border: thin #FFFF00 solid;
}
edit: Removed <header>, it did not effect problem.
Answer: The problem was a combination of tags not matched and use of the same name in two containters.
This could be caused by a variety of problems. Without having a website to view it's going to be difficult for anyone here to answer your question.
One of the easiest ways to diagnose CSS problems like this is to use the Firefox extension Firebug. Inspect the text that is appearing gray and see exactly what styles are being applied to it. The styles are shown in a hierarchy from bottom to top.
I don't know if you just formatted your example this way for Stack Overflow, but you should not be including the <head> or <body> tags in your container. DotNetNuke will automatically load the CSS file called container.css if it is in the same directory as your container HTML or ASCX file. It will additionally load any CSS file that has the same name as the container being loaded. For example, if you have a container called MyContainer.ascx, DotNetNuke will automatically load container.css and MyContainer.css, provided they exist.