popup modal clickable background - html

I want my modal to disable all clicks on the background, it currently allows me to click the background when there is a button or link. How do I disable that because I thought the pointer:none was supposed to disable that?
Any help would be appreciated.
This is my CSS code and HTML code:
.ng-modal-overlay {
/* A dark translucent div that covers the whole screen */
position: fixed;
z-index: 9999;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000000;
opacity:1.0;
pointer-events: none;
}
.ng-modal-dialog {
/* A centered div above the overlay with a box shadow. */
z-index: 10000;
position: fixed;
width: 50%; /* Default */
/* Center the dialog */
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
background-color: #fff;
box-shadow: 4px 4px 80px #000;
pointer-events: auto;
}
.ng-modal-dialog-content {
padding: 10px;
text-align: left;
}
.ng-modal-dialog-footer {
margin-top:40px;
text-align:right;
}
.ng-modal-close {
position: absolute;
top: 3px;
right: 5px;
padding: 5px;
cursor: pointer;
font-size: 150%;
color:red;
display: inline-block;
font-weight: bold;
font-family: 'arial', 'sans-serif';
}
<modal-dialog show="TeamManagementModal" class="ng-modal-overlay" data-backdrop="false">
<div class="modal-inner">
<div class=".ng-modal-dialog-content">
<p ng-bind-html="msg"></p>
<p ng-bind-html="ErrorMsg"></p>
</div>
<div class="ng-modal-dialog-footer">
<button style="width:160px;" class="btn solid-green-btn" ng-show="nowAdminOk" ng-click="Great()">Great</button>
</div>
</div>
</modal-dialog>

Related

How to Overly Text and Button on an Image

I'm trying to place Text and button on an image like this. Can someone help with this.
this is what I have tried. The thing is it does render properly in outlook email
CSS:
.container {
position: relative;
width: 100%;
max-width: 400px;
}
.container img {
width: 100%;
height: auto;
}
.container .btn {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
background-color: #55A646;
color: white;
font-size: 16px;
padding: 12px 24px;
border: none;
cursor: pointer;
border-radius: 5px;
text-align: center;
}
.container .btn:hover {
background-color: #55A646 ;
}
HTML:
<div class="container">
<img src="http://image.com" alt="" style="width:100%">
<button class="btn">Button</button>
</div>
Folow The link: https://www.w3schools.com/howto/howto_css_image_text.asp
/* Container holding the image and the text */
.container {
position: relative;
text-align: center;
color: white;
}
/* Bottom center text */
.bottom-center {
position: absolute;
bottom: 8px;
left: 45%;
}
/* Centered text */
.centered {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<div class="container">
<img src="https://cdn.searchenginejournal.com/wp-content/uploads/2019/07/the-essential-guide-to-using-images-legally-online-760x400.png" alt="Snow" style="width:100%;">
<div class="bottom-center">
<button>Bottom Center</button>
</div>
<div class="centered">Centered</div>
</div>
try this instead,
.container {
position: relative;
width: 100%;
max-width: 400px;
}
.container img {
width: 100%;
height: 100%
}
.container .btn {
position: absolute;
bottom: 10px;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
background-color: #55A646;
color: white;
font-size: 16px;
padding: 12px 24px;
border: none;
cursor: pointer;
border-radius: 5px;
text-align: center;
}
.container .btn:hover {
background-color: #00cc00 ;
}
h4{
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
color: #fff;
background:#111;
padding: 7px;
}
<div class="container">
<img src="https://i.stack.imgur.com/bf3jO.png" alt="" style="width:100%">
<h4>The table Fan</h4>
<button class="btn">Fan</button>
</div>

simple button effect will not work

I am trying to do a simple button animation but it will not work for some reason. I took the code from my brackets editor and put it in a codepen and it worked fine, but it will not work within the brackets editor.The new button works fine, but the other two will not. Any ideas?
.btn-style {
font-family: 'Montserrat', sans-serif;
font-weight: 300;
color: #5C5C5C;
background: none;
outline: none;
border: none;
}
.btn-new {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
top: 30px;
font-size: 25px;
}
.btn-roll {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
top: 370px;
font-size: 25px;
}
.btn-hold {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
top: 415px;
font-size: 25px;
}
button:hover {
color: black;
}
.btn-new:active {
top: 32px;
}
.btn-roll:active {
top: 372px;
}
.btn-hold:active {
top: 417px;
}
<button type="button" class="btn-new btn-style">New Game</button>
<button type="button" class="btn-roll btn-style">Roll Dice</button>
<button type="button" class="btn-hold btn-style">Hold</button>
I don't know what's wrong with the animation, because your code is correct. Is there any other stylesheet or script that could interfere with the animation?
However, here's some advice that might solve the problem: Don't use absolute positioning where possible.
Here, instead of changing the top property, you can change the margin to move the buttons down by 2 pixels:
.btn-new:active, .btn-roll:active, .btn-hold:active {
margin: 2px 0 -2px 0;
}
And here's the full example:
.btn-style {
font-family: 'Montserrat', sans-serif;
font-weight: 300;
color: #5C5C5C;
background: none;
outline: none;
border: none;
margin: 0;
}
.btn-new {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
top: 30px;
font-size: 25px;
}
.btn-roll {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
top: 370px;
font-size: 25px;
}
.btn-hold {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
top: 415px;
font-size: 25px;
}
button:hover {
color: black;
}
.btn-new:active, .btn-roll:active, .btn-hold:active {
margin: 2px 0 -2px 0;
}
<button type="button" class="btn-new btn-style">New Game</button>
<button type="button" class="btn-roll btn-style">Roll Dice</button>
<button type="button" class="btn-hold btn-style">Hold</button>

Text alignment not center in all devices

I have a footer div with this code
.footer {
width: 100%;
height: 50px;
position: absolute;
bottom: 0;
background-color: #DDD;
}
.center-xy {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.footer-text {
font-family: 'Calibri';
font-size: 0.8em;
}
.footer-text a {
text-decoration: none;
}
<nav class="footer">
<div class="center-xy footer-text">
Made with <span style="color: red; font-size: 1.5em;">♥</span> by <strong>Shantanu Banerjee</strong>
</div>
</nav>
The problem is the footer-text is well centered in Laptop Screens and mobile phones. But on Mobile Phones the text comes in 2-lines.
What is the solution?
I am not sure about the code(at the time of posting the comment), but it looks like there's a lot of padding because even with adequate visible space, the text is wrapping. So..
Reduce padding around the text. OR
Apply white-space: nowrap; for your text.
Just add the following css
.footer-text {
min-width: 200px;
text-align: center;
}
And it will be fixed.
Here's a working demo:
.footer {
width: 100%;
height: 50px;
position: absolute;
bottom: 0;
background-color: #DDD;
}
.center-xy {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.footer-text {
font-family: 'Calibri';
font-size: 0.8em;
}
.footer-text a {
text-decoration: none;
}
.footer-text {
min-width: 200px;
text-align: center;
}
<nav class="footer">
<div class="center-xy footer-text">
Made with <span style="color: red; font-size: 1.5em;">♥</span> by <strong>Shantanu Banerjee</strong>
</div>
</nav>
try this:
.footer {
position: absolute;
bottom: 0;
margin:0;
background-color: #DDD;
left:0;
right:0;
padding:15px 0;
text-align:center
}
.center-xy {
}
.footer-text {
font-family: 'Calibri';
font-size: 0.8em;
}
.footer-text a {
text-decoration: none;
}
<nav class="footer">
<div class="center-xy footer-text">
Made with <span style="color: red; font-size: 1.5em;">♥</span> by <strong>Shantanu Banerjee</strong>
</div>
</nav>
just use
.center-xy {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
}

Add corner ribbon to bootstrap site

How do I get this ribbon to be on of my bootstrap page as the top layer? Solid color and solid text.
html:
<div class="corner-ribbon bottom-left sticky orange">Hello</div>
CSS:
/* The ribbons */
.corner-ribbon{
width: 200px;
background: #e43;
position: absolute;
top: 25px;
left: -50px;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
/* Custom styles */
.corner-ribbon.sticky{
position: fixed;
}
.corner-ribbon.shadow{
box-shadow: 0 0 3px rgba(0,0,0,.3);
}
.corner-ribbon.bottom-left{
top: auto;
bottom: 25px;
left: -50px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
/* Colors */
.corner-ribbon.white{background: #f0f0f0; color: #555;}
.corner-ribbon.black{background: #333;}
.corner-ribbon.grey{background: #999;}
.corner-ribbon.blue{background: #39d;}
.corner-ribbon.green{background: #2c7;}
.corner-ribbon.turquoise{background: #1b9;}
.corner-ribbon.purple{background: #95b;}
.corner-ribbon.red{background: #e43;}
.corner-ribbon.orange{background: #e82;}
.corner-ribbon.yellow{background: #ec0;}
As it is now the ribbon in on the same "level" as the background. Meaning that youtube iframe links etc. will go on the top of the ribbon.
I use this template:
https://blackrockdigital.github.io/startbootstrap-agency/
If you would recommend me to use another code, please let me know.
Just use z-index:
/* The ribbons */
.corner-ribbon{
width: 200px;
background: #e43;
top: 25px;
left: -50px;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
/* Pay attention! */
z-index: 1;
position: fixed;
}
/* Custom styles */
.
corner-ribbon.sticky{
position: fixed;
}
.corner-ribbon.shadow{
box-shadow: 0 0 3px rgba(0,0,0,.3);
}
.corner-ribbon.bottom-left{
top: auto;
bottom: 25px;
left: -50px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
/* Colors */
.corner-ribbon.white{background: #f0f0f0; color: #555;}
.corner-ribbon.black{background: #333;}
.corner-ribbon.grey{background: #999;}
.corner-ribbon.blue{background: #39d;}
.corner-ribbon.green{background: #2c7;}
.corner-ribbon.turquoise{background: #1b9;}
.corner-ribbon.purple{background: #95b;}
.corner-ribbon.red{background: #e43;}
.corner-ribbon.orange{background: #e82;}
.corner-ribbon.yellow{background: #ec0;}
.annoying_block{
position: absolute;
bottom: 10px;
left: 10px;
width: 50vw;
height: 100px;
background-color: red;
}
<div class="corner-ribbon bottom-left sticky orange">Hello</div>
<div class="annoying_block">
</div>
If I understand correctly, what you're looking for is the z-index property.
.corner-ribbon{
z-index: 100;
width: 200px;
background: #e43;
position: absolute;
top: 25px;
left: -50px;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: #f0f0f0;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}

Why is my FontAwesome content appearing off center as a background?

I am trying to set a FontAwesome icon as a "defualt thumbnail" for a list of articles. My problem is that the icon is appearing off center horizontally in my div. See the jsFiddle.
<div class="card-row-image fa fa-cutlery thumbnail-default">
<div class="card-row-label">Restaurants
</div>
<div class="card-row-price">Pennsylvania</div>
</div>
.thumbnail-default {
position: relative;
text-align: center;
border: 1px solid #547b97;
background: #e4e4e4;
}
.thumbnail-default:before {
position:absolute;
font-family: 'FontAwesome';
font-size: 72px;
color: #547b97;
text-align: center;
padding: 0px;
margin: 0px;
top: 50%;
transform: translateY(-50%);
}
.card-row-price {
background-color: #009f8b;
bottom: 0px;
color: #fff;
font-size: 13px;
left: 50%;
padding: 3px 15px;
position: absolute;
transform: translateX(-50%);
-webkit-transform: translateX(-50%);
white-space: nowrap;
z-index: 2;
}
.card-row-label {
background-color: #c6af5c;
color: #fff;
left: 50%;
font-size: 13px;
padding: 3px 15px;
position: absolute;
top: 0px;
transform: translateX(-50%);
-webkit-transform: translateX(-50%);
z-index: 2;
}
.card-row-image {
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
height: 200px;
position: relative;
width: 262px; }
Here is my current output:
Any ideas? Thanks for your time!
set these css codes to make it centered. This happens because on absolute positioned pseudo elements, if you do not specify where to be horizontally (you did not set left or right property), it will follow the text flow and would obey the text-align: center set on the parent.
.thumbnail-default:before { left: 50%; transform: translate(-50%, -50%); }
Working Fiddle