I'm working on an improvement to an Angular webpage. It currently looks like this:
I'm tasked with adding a light blue overlay that blurs the data in the table based on a boolean value. It's supposed to look like this:
I'm using a p-table from the PrimeNG library of components (PrimeNG 14.0.0 on Angular 14.1.0). My main issue is showing this component covering the totality of the table content (ignoring the table headers if possible), and having the text aligned in the middle of the component. I've managed to blur the data in the table already with this class:
.blur-cover {
filter: blur(3px);
pointer-events: none;
user-select: none;
}
but the blue area with the text in it covering the content is a mystery to me.
Wrap your p-table in a div add the class blur-cover to it
<div class="blur-cover">
... your p-table here
<p class="text-container">
some long text
</p>
</div>
and use css add blur backgroup to the tbody and adjust the position of the text in your style.css
.blur-cover {
position: relative;
}
.blur-cover tbody {
filter: blur(3px);
pointer-events: none;
user-select: none;
}
.blur-cover .text-container {
position: absolute;
top: calc(50%);
left: calc(50% - 50px);
}
working demo
Related
I am having troubles resizing the slideshow on my Shopify css.
This is the code
/* Slider */
.slick-slider
{
position: relative;
display: block;
box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-khtml-user-select: none;
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-tap-highlight-color: transparent;
}
I am using the boost theme,
I have tried toggling height and weight with these arguments:
height: 50%
width: 50%
and
max-height:50%
but to no avail. I would like to halve the height and width of my slider
I took a look at your source code, and if you're referring to the main homepage carousel, it looks like your slider is wrapped in the following div:
<div class="full-width relative js-slideshow-section slick-initialized slick-slider slick-dotted" data-autoplay="true" data-autoplayspeed="8000">
The full-width class applies the following CSS rule in your theme.scss.css:
.full-width {
min-width: 100%;
}
Your CSS rules are being ignored because of selector specificity. Either replace the class full-width or if you want to change the size based on viewport size, consider adding a media query that overrides those rules.
If you'd like to reduce the height of your carousel, consider styling, not the slider container itself, but each individual slide. The following CSS would adjust the slider width to 50%, center it with margin rules, and adjust the height of slides with a class of .slide-heightchange to 400px:
/* Slide container */
.full-width.adjusted-width {
width: 50%;
margin-left: auto;
margin-right: auto;
}
/* Individual slide */
.slide-adjusted-height {
height: 400px;
}
Note that I added the adjusted-width class to your carousel container selector. This, together with the full-width class will create a more specific CSS selector that should apply the rule. However, for semantic purposes you may consider renaming the full-width class or removing it altogether with JavaScript on resize. Also, the width: 50%; rule will change the width size based on the containing block size. You may want to consider a different width rule.
Related info
It looks like your Shopify theme is using the Slick library for the slider. The documentation and sample usage can be found at http://kenwheeler.github.io/slick/
As the docs explain, your slide divs are placed inside of a div container that is then used to initialize the carousel.
Something else that might be useful is configuring the slider's JS settings. The Slick library has adaptiveHeight and variableWidth settings that both default to false. They allow you to configure the behavior of your carousel when dealing with slides of different heights and widths.
I am trying to implement navigation arrows as they work in this ekko-lightbox gallery example - they appear on the right and left only when the mouse is hovering over just the right or left side of the image. I've been combing through the scripts in Developer Tools and still can't deduce how it's done (I'm pretty new to css). I have the arrows on my site appearing on hover, but I would like to use this more subtle approach of having only one at a time appear depending on which side of the image you're on.
Ekko lightbox is based on Bootstrap's modals, so perhaps there is a way in CSS to do something like this(?):
.modal-content(width: 50%):hover .arrow-left {
display: block;
}
Most of the time you create elements that cover the area you want control the hover then use display or something like opacity on hover to adjust. here is an simple example
.lightBox {
width: 800px;
height: 400px;
border: 1px solid black;
}
.navHolder {
width: 50%;
float: left;
height: 100%;
opacity: 0;
}
.navHolder:hover {
opacity: 1;
}
<div class="lightBox">
<div class="navHolder">
<span>arrow</span>
</div>
<div class="navHolder">
<span>arrow</span>
</div>
</div>
Ok so, I have this map:
I need to add a rollover effect to the country names (this could be done with a simple :hover in CSS) but I can't find a good way to select just a portion of the text so if I hover "Europe" it just highlights Europe and not every word.
The image is in a PSD so I have access to the base map + layers. How could I approach this? I was thinking about adding all the text in HTML and style it in CSS (rotating, spacing and such), which would take ages, and it would also be a pain to manage when adapting for different resolutions.
Can you masters suggest anything? Thanks :)
The images for reference (text made red just to show there's something there, this would be the rollover effect):
Here's an idea:
body {
position: relative;
}
img {
width: 100%;
}
.states {
position: absolute;
top: 0;
left: 0;
display: none;
}
.map-container {
width:960px;
transform-origin: 0px 0px;
transform: scale(0.8);
}
a.state-name {
position:absolute;
}
a.state-name:hover {
background-image: url("http://i.stack.imgur.com/aB42n.gif");
}
a#europe {
background-position: -420px -140px;
left: 420px;
top: 140px;
height: 45px;
width: 210px;
}
<div class="map-container">
<img src="http://i.stack.imgur.com/319c9.gif" />
<img src="http://i.stack.imgur.com/aB42n.gif" class="states" />
<a id="europe" class="state-name" href="#"></a>
</div>
Note:
you need to define for each country name a a tag and proper css rules: background-position, width, height, left, top like for #europe example
.map-container - must have the same width as the original image 960px
you need to use JS or CSS transform property to scale the whole .map-container if you need to resize the map, otherwise the hover elements will be misplaced.
Pay attention to css transform properties
This is an experimental technology. Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.
I am an illustrator making a portfolio site.
I'm trying to simply create a rollover css transition with Dreamweaver. I would like it so when you roll over the image the text will rise up to give a description about the image.
Do you mean something like this - DEMO?
What I've done is, I've created two classes (.pic and .text). .pic holds the picture and the other class contains the text. The .text class is positioned at the bottom of .pic and it has a height of 0; To make the text appear when you :hover over the image I just transition the height of .text, in this case from 0 to 150px;
Here the code from my demo
HTML
<div class="pic"><img src="http://placekitten.com/200/300" />
<div class="text"><p>This is a cat</p></div>
</div>
CSS
.pic {
position: relative;
width: 200px;
height: 300px;
overflow: hidden;
}
.text {
position: absolute;
bottom: 0;
right: 0;
width: 200px;
height: 0;
text-align: center;
background: rgba(255, 255, 255, 0.7);
transition: height 0.7s ease-out;
}
.pic:hover > .text {
height: 150px;
}
by rolling over the image, do you mean mouse-over event? this can be done in multiple ways. but probably if you dont have too much css or javascript knowledge. then just download an image caption plugin. one such plugin that comes to my mind is called jquery capty. just google it and follow instruction of adding like 2 lines of code. its that simple.another way is using CSS positioning of the caption text over the image and use display:none initially and on mouse hover event, use the css :hover pseudo class and give it display: inline-block. hopefully this helps
The best way to do this would be to add a :hover event within your CSS file once you're within Dreamweaver.
Something similar to this:
.class {
background: blue;
}
.class:hover {
background: red;
}
DEMO
This is not something that I've seen Illustrator be able to do and transfer it to Dreamweaver
I wanted to add an overlay to an image if they hovered over the image.
I have tried plenty of ways but the image just seems to disappear or stay the same.
This is what it will be like
<a id="icon"
style="background: url(/images/layout/top/icon.gif); height:23px; width:23px; float:left; margin-right:3px;"
href="page.php?pageid=123" title="Icon">
</a>
Really and truly, what I am after is a quick way to have the image change without having to make more images.
So when not hovering over the image - Original image
When hovering over the image - 40% color overlay?
Thanks in advanced.
What I tried:
a.thumbnail {
background-color:orange;
filter: Alpha(Opacity=40, Style=0);
-moz-opacity: 40%;
opacity: 0.4;
}
I created a little fiddle that has this doesn't overlay, but gives the same effect using just CSS. Plus, I threw in some CSS transitions for fun. Basically creating a div behind the image that is revealed via pseudo element hover. This way you can drop in your tags still without needing to create CSS background images like crazy. Just swap out the alpha stuff to make the overlay work the other way.
http://jsfiddle.net/wesleyterry/jwXvA/#base
Hope that is what you were looking for.
Basically, if it's an overlay you can assume the height and width is probably going to be the same.
in this demo i accidentally used images sized 25. change to 23
http://jsfiddle.net/raU2J/7/
<div class="overlay_wrapper">
<div class="overlay"></div>
<img src="cake.jpg" />
</div>
.overlay,
.overlay_wrapper a,
.overlay_wrapper {
width: 25px;
height: 25px;
position: relative;
}
.overlay_wrapper a {
position: absolute;
z-index: 10;
display: block;
}
.overlay {
display: none;
background: red;
position: absolute;
top: 0;
left: 0;
filter: Alpha(Opacity=40, Style=0);
-moz-opacity: 40%;
opacity: 0.4;
z-index: 9;
}
jquery:
$(".overlay_wrapper").hover(
function () {
$(this).find('.overlay').fadeIn();
},
function () {
$(this).find('.overlay').fadeOut();
}
);
This is not possible with just the single <a>, but you can put the <a> in a container (a span or a div). Give the container the desired background, and give a:hover a background color like rgba(255, 255, 255,.4).
If that doesn't work like you want, explain more about your requirements.
The sample demo:
html
<div class="img"><div class="overlap"></div></div>
css
.img {width:100px;height:100px;background:red;position:relative;}
.overlap { visibility:hidden;}
.hover .overlap {position:absolute;top:0;left:0;width:100px;height:100px;background:#333;filter:alpha(opacity=40); /* for IE */ -moz-opacity:0.4; opacity: 0.4;-khtml-opacity: 0.4; visibility:visible;}