Why Business Owners Should Invest in Retirement Early
The world’s most powerful GDP, the American economy is chock-full of business owners. According to the U.S. Small Business Administration, small businesses employ 47.3% of the American workforce and generate nearly half of the country’s...
The post Why Business Owners Should Invest in Retirement Early appeared first on 85ideas.com.
TravelPerk Adds Emissions Data API to Travel Data Platform
Business Travel News has recently reported on the launch of a new API by TravelPerk, a travel management platform that tracks emissions data, which aims to highlight granular carbon footprint data. The new TravelPerk GreenPerk API aggregates emissions data from myriad travel companies across the globe.
Writing to 2d array with fscan
Im trying to scan in a txt file with a string of numbers.
t.txt
123
223
323
<#include stdlib.c>
<#include stdio.c>
<#include string.h>
int main{
char grid[3][3];
int i = 0;
File *f = fopen(t.txt, r)
while (i != 3){
for (int j = 0; j < 3; j++){
fscanf(f, %1c, &grid[i][j]);
}
i++;
}
}
But it prints a segment fault.
Populating 2d array with scan
Im trying to scan in a txt file with a string of numbers.
t.txt
123
223
323
File *f = fopen(t.txt, r)
while (i != 3){
for (int j = 0; j < 3; j++){
fscanf(f, %1c, &grid[i][j]);
}
i++;
}
But it prints a segment fault.
How to Make a “Raise the Curtains” Effect in CSS
“Raise the curtains” is what I call an effect where the background goes from dark to light on scroll, and the content on top also goes from light to dark while in a sticky position.
Here’s an example where I used the effect on a real-life project:
Want to know how it’s done? I will take you behind the curtain and show you how to raise it, with nothing but HTML and CSS.
Let’s start with the HTML
What we’re making is sort of a simplified “raise the curtain” effect like this:
I’m keeping things simple for the sake of clarity, but we can stub this out with three elements:
<div class="curtain">
<div class="invert">
<h2>Section title</h2>
</div>
</div>
First, we need a container for the curtain, which we’ll give a .curtain
class. Then, inside the .curtain
, we have the an .invert
child element that will serve as our “sticky” box. And, finally, we have the content inside this box — a good old-fashioned <h2>
element for this specific example.
Let’s set up some CSS variables
There are three values we know we’ll need upfront. Let’s make CSS variables out of them so it’s easy to write them into our styles and easily change them later if we need to.
--minh
– The height of the container--color1
– The light color--color2
– The dark color
:root {
--minh: 98vh;
--color1: wheat;
--color2: midnightblue;
}
Time to draw the curtain
Next, we can define our .curtain
element using the following techniques:
- A
linear-gradient
for the “split” background min-height
for the extra space at the bottom of the container
We use the ::after
pseudo-element to add the extra space to the bottom. This way, our “sticky” content will actually stick to the container while scrolling past the ::after
element. It’s an illusion.
.curtain {
/** create the "split" background **/
background-image: linear-gradient(to bottom, var(--color2) 50%, var(--color1) 50%);
}
/** add extra space to the bottom (need this for the "sticky" effect) **/
.curtain::after {
content: "";
display: block;
min-height: var(--minh);
}
Making sticky content
Next up, we need to make our content “sticky” in the sense that it sits perfectly inside the container as the background and text swap color values. In fact, we already gave the .curtain
‘s child element an .invert
class that we can use as the sticky container.
Stay with me for a moment — here’s how this is going to play out:
position: sticky
andtop
define the stickiness and where it sticks.mix-blend-mode: difference
blends the color of the content inside the<h2>
element into the.curtain
‘s background gradient.display: flex
centers the content for presentation.min-height
defines the height of the container and allows for the extra space at the bottom.color
sets the color of theh2
heading.
Now to put that into CSS code!
.invert {
/** make the content sticky **/
position: sticky;
top: 20px;
/** blend the content with the contrast effect **/
mix-blend-mode: difference;
/** center the content **/
display: flex;
align-items: center;
justify-content: center;
/** set the minimum height of the section **/
min-height: var(--minh);
}
h2 {
/** set the color of the text **/
color: var(--color1);
}
There are many things going on here, so let’s explain each one of them.
First, we have a sticky position that is self-explanatory and flexbox to help center the content. Nothing new or particularly tricky about this.
The content’s height is set using CSS variable and the value is the same height value as the .curtain::after
pseudo-element.
The mix-blend-mode: difference
declaration blends our content with the background. The difference
value is complicated, but you might visualize it like inverted text color against the background. Here’s a nice demo from the CSS-Tricks Almanac showing off the different mix-blend-mode
values:
To make the blending work, we need to set the color of our heading. In this case, we’re assigning a light color value (wheat
) to the --color1
variable.
“Raise the Curtains” Demo
Gotchas
I experienced a few problems while working out the details of the “raise the curtain” effect. If you want to add images to the “sticky” content, for example, avoid using images that don’t look good when their colors are inverted. Here’s a quick demo where I made a simple SVG and transparent PNG image, and it looks good.
Another gotcha: there’s no way to set mix-blend-mode: difference
on specific child elements, like headings, while avoiding the effect on images. I discovered there are several reasons why it doesn’t work, the first of which is that position: sticky
cancels the blending.
The same goes when using something like transform: skewY
on the container to add a little “tilt” to things. I suspect other properties don’t play well with the blending, but I didn’t go that far to find out which ones.
Here’s the demo without scrolling that removes the troubling properties:
Curtain call!
I enjoyed building this component, and I always love it when I can accomplish something using only HTML and CSS, especially when they work smoothly on every browser.
What will make with it? Is there a different way you would approach a “raise the curtain” effect like this? Let me know in the comments!
How to Make a “Raise the Curtains” Effect in CSS originally published on CSS-Tricks. You should get the newsletter.
Photoshop Brushes: Download Free Space, Stars And Planet Brushes
Space art has been rising in popularity thanks to people’s curiosity for the unknown and the beautiful images from NASA that amazed and inspired us over the years. Today designers are letting their imagination run wild, and creating some of their own space art in the form of Photoshop brushes. In this article, you will...
The post Photoshop Brushes: Download Free Space, Stars And Planet Brushes appeared first on DesignrFix.
Fscanf seg fault
Ive been trying to use the fscanf function to read a txt file containing a single number into a ptr:
(file.txt)
1
File *fPtr=fopen(file.txt, r)
int r;
fscanf(fPtr, %d, &r);
I keep getting a segmentation fault, after running it though the program compiles. It happens pretty much any other way I try to call Fscanf too.
DreamHost Review: Should You Use Them to Host Your Next Website?
Top 7 T-shirt Design Tool Providers For the Printing Industry
Customized t-shirts are liked by the youngsters a lot. They often wear t-shirts with witty one-liners, logos of football teams and many other things. With the T-shirt business becoming more and more user-centric, it is imperative that customers have a design tool that can be used for creating designs on t-shirts with ease. Unlike complex...
The post Top 7 T-shirt Design Tool Providers For the Printing Industry appeared first on DesignrFix.
7 Simple Ways to Improve Your Conversion Rate
When it comes to building the website for your small business, it goes without saying that its’ design should be aesthetically appealing. But, this doesn’t mean that you should get carried away. Some of us get so caught up with website design that we forget the fundamental purpose of our sites – to convert traffic...
The post 7 Simple Ways to Improve Your Conversion Rate appeared first on DesignrFix.
re: Instagram, is there any point to putting hashtags…
Is there any point to putting hashtags in your Instagram profile bio? Will those be found in a search?
Can a posting's caption & info be edited after posting?
Also, I have a domain name, and I have that domain name as my IG username, but someone else has an account name with my domain name, for example, like so: #mydomainname can we both have #mydomainname or am I going to be stuck with just mydomainname (without the #)? Will it make that much difference when people are searching?
If I have the IG account just to give my web site some visibility, how would following others help with that?
How to Add Nofollow Links in WordPress Navigation Menus
Do you need to add nofollow links in your WordPress navigation menus?
Many website owners prefer to add a nofollow tag to external links, but beginners may find this tricky when adding a custom link to a menu.
In this article, we’ll show you how to add nofollow links in WordPress navigation menus.
Why Add Nofollow Links in WordPress Navigation Menus?
If you are running a WordPress website, then you may want to add a nofollow tag when creating external links. This lets search engines know not to pass any link authority from your page to the other website that you’re linking to.
When you link to an external website, search engines consider that as a ranking signal, and they will pass a small portion of your authority to the other website. As a general SEO best practice, you should add nofollow to all external websites that you don’t trust.
You do that by adding the rel="nofollow"
attribute to the link like this:
<a href="https://example.com" rel="nofollow">Example</a>
You can learn more in our beginner’s guide on how to add nofollow links in WordPress. However, adding nofollow links to navigation menu items is a little different and can be confusing for beginners.
In this article, we will show you how to add nofollow links in WordPress navigation menus. We’ll cover two methods, and the second method is for those using WordPress 5.9 or higher and a theme that’s compatible with the new theme editor.
- Method 1: Adding Nofollow Links Using the WordPress Menu Editor
- Method 2: Adding Nofollow Links Using the WordPress Theme Editor
Method 1: Adding Nofollow Links Using the WordPress Menu Editor
To get started, simply visit Appearance » Menus in your WordPress admin area.
First, you need to add the external link to your WordPress navigation menu just like you would add any custom link.
To do that, you need to click on the ‘Custom Links’ tab so you can see the URL and Link Text options. Simply enter the URL and link text of the website you are linking to.
After that, you should click the ‘Add to Menu’ button and the link will be added to the ‘Menu structure’ column.
To add the nofollow attribute to the link, you need to click the downward arrow on the right of the menu entry, as pictured in the screenshot above. You can now see the details of the external link you just added, including the URL and navigation label.
If you don’t see the Link Target and Link Relationship options, then you will have to add them.
To show those options, you need to click the ‘Screen Options’ button at the top right corner of the screen. Then check the boxes next to the Link Target and Link Relationship (XFN) options.
Now you can scroll back down to your expanded menu item, and you will notice two new options. Next, simply enter nofollow
in the link relationship field.
We recommend that you also click the ‘Open link in a new tab’ checkbox when adding an external link. This is a great way to improve engagement and keep your visitors from leaving your website.
Lastly, click the ‘Save Menu’ button to store your changes.
You can now preview your site to see the new nofollow menu entry.
Let’s make sure that a nofollow attribute has been added to the link.
Simply right click the new link and select ‘Inspect’. Your browser window will split into two windows. In the bottom window, you will be able to see the HTML source for your link. It will display the nofollow attribute with your link.
Method 2: Adding Nofollow Links Using the WordPress Theme Editor
This method is for those who are using WordPress 5.9 or later and have a theme that supports the new WordPress theme editor. In that case, the Appearance » Menus page will not be available to you.
Instead, you should navigate to Appearance » Editor in your WordPress dashboard. This will open the WordPress theme editor.
Adding a New Link to the Navigation Menu
If you need to add a new menu item, then you’ll have to click the blue Block Inserter icon in the top left corner. Next, you should scroll down until you locate the Custom Link block and then drag it onto your navigation menu.
You can now type or paste the URL. If you want, you can also toggle the ‘Open in new tab’ option to the on position. After that, make sure you click the Submit icon at the top right of the popup so that the menu item’s settings are stored.
The link URL will be added to the menu, but you’ll normally want something more descriptive, such as the name of the website. Simply start typing to rename the menu item.
Adding the Nofollow Attribute to a Link
To add the nofollow attribute to a menu item, simply click it and a toolbar will appear.
Next you need to click the link icon on that toolbar. In the settings pane on the right, you need to enter nofollow
in the link relationship (‘Link rel’) field.
If you like, you can also add a description and title for the link, and reorder the menu items using the arrow icons on the toolbar.
When you’ve finished, click the ‘Save’ button at the top of the screen. The new custom link will be added and you can visit your website to see how your navigation menu looks now.
We hope this tutorial helped you learn how to add nofollow links in WordPress navigation menus. You may also want to learn how to create automated workflows in WordPress with Uncanny Automator, or check out our list of tips to speed up WordPress performance.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
The post How to Add Nofollow Links in WordPress Navigation Menus first appeared on WPBeginner.
Premium E-Commerce Plugins for WordPress You Should Have on Your Site
Selling products online isn’t easy. But you could make it easy by simply installing the right plugins. In the following text, you will find four eCommerce plugins. These plugins will improve your website performance, help...
The post Premium E-Commerce Plugins for WordPress You Should Have on Your Site appeared first on 85ideas.com.
Basic Tutorial On Creating Dynamic Menu Items In WordPress Pages
WordPress is well-known for providing a wide spectrum of functionality, enabling users to set up their website consisting of a rich suite of features. One great feature of WordPress is its menu system, which helps in managing a website menu in an effortless manner. In fact, the menu system became even better with the release...
The post Basic Tutorial On Creating Dynamic Menu Items In WordPress Pages appeared first on DesignrFix.
GREYD.SUITE – All-In-One Solution for WordPress
You’ve chosen WordPress as your CMS and found your way to build beautiful websites with it? But there are some things you always have to deal with, like for example that WordPress alone does not...
The post GREYD.SUITE – All-In-One Solution for WordPress appeared first on 85ideas.com.
30+ Examples of HTML5 Websites
This post is originally published on Designmodo: 30+ Examples of HTML5 Websites
Creating a basic website is no longer enough to present the company in all its glory, onboard potential customers, and generate conversions these days. Users expect much more than just a simple static web page. They look for interactive and …
For more information please contact Designmodo
Web Design Trends to Apply to Your Work
Web design trends keep evolving. New design trends emerge, some of them stay for years while others come and go in a flash. Web design is a dynamic field, trends change very rapidly. New design trends appear because of the evolving needs of the users. As a web designer, you have to be aware of ... Read more
The post Web Design Trends to Apply to Your Work appeared first on Designs Authority.