Making Tables With Sticky Header and Footers Got a Bit Easier

Category Image 091

It wasn’t long ago when I looked at sticky headers and footers in HTML <table>s in the blog post A table with both a sticky header and a sticky first column. In it, I never used position: sticky on any <thead>, <tfoot>, or <tr> element, because even though Safari and Firefox could do that, Chrome could not. But it could do table cells like <th> and <td>, which was a decent-enough workaround.

Well that’s changed.

Sounds like a big effort went into totally revamping tables in the rendering engine in Chromium, bringing tables up to speed. It’s not just the stickiness that was fixed, but all sorts of things. I’ll just focus on the sticky thing since that’s what I looked at.

The headline to me is that <thead> and <tfoot> are sticky-able. That seems like it will be the most common use case here.

table thead,
table tfoot {
  position: sticky;
}
table thead {
  inset-block-start: 0; /* "top" */
}
table tfoot {
  inset-block-end: 0; /* "bottom" */
}

That works in all three major browsers. You might want to get clever and only sticky them at certain minimum viewport heights or something, but the point is it works.

I heard several questions about table columns as well. My original article had a sticky first column (that was kind of the point). While there is a table <col> tag, it’s… weird. It doesn’t actually wrap columns, it’s more like a pointer thing to be able to style down the column if you need to. I hardly ever see it used, but it’s there. Anyway, you totally can’t position: sticky; a <col>, but you can make sticky columns. You need to select all the cells in that column and stick them to the left or right. Here’s that using logical properties…

table tr th:first-child {
  position: sticky;
  inset-inline-start: 0; /* "left" */
}

Here’s a sorta obnoxious table where the <thead>, <tfoot>, and the first and last columns are all sticky.

I’m sure you could do something tasteful with this. Like maybe:


The post Making Tables With Sticky Header and Footers Got a Bit Easier appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

assembly langguage

558fe5180e0e8fc922d31c23ef84d240

helo! im an comp engineering student and i need ur help. i have to do a Reminder system using assembly language
|-ask user key in input |-clock system |-timer system |-output.
thats the basic idea that i have for now. we are using the emulator x86, here the link https://carlosrafaelgn.com.br/Asm86/
so the input is only keypad and the output is on/off light

How can I limit number of bookings in SQL where per month only 5 bookings

Category Image 101

I have three tables:

First table is 'user':

user_id  |    Name   |
----------------------
1234354  | Abu Bakar |           
2543353  | Ali       |    
3342342  | Aliza     |    
4234243  | Ali       |  
5234324  | Mike      |     


Second table is 'meeting':

meeting_id  | meeting_name  |  meeting_startDate  | meeting_endDate | room_name  |
----------------------------------------------------------------------------------
1           | Discussion 1  |     2021-05-29      |   2021-05-31    |   room 1   |
2           | Discussion 2  |     2021-06-01      |   2021-06-02    |   room 2   |
3           | Discussion 3  |     2021-05-02      |   2021-05-02    |   room 1   |
4           | Discussion 4  |     2021-05-03      |   2021-05-03    |   room 1   |
5           | Discussion 5  |     2021-05-04      |   2021-05-04    |   room 1   |


Third table is 'booking':

book_id  |  meeting_id  |  user_id  | 
-------------------------------------
0001     |      1       |  1234354  |
0002     |      2       |  1234354  |
0003     |      3       |  1234354  |
0004     |      4       |  1234354  |
0005     |      5       |  1234354  |

I want to allow per user can book each room_name up until 5 times for per month.

(Example: Abu Bakar can book room 1 only for 5 times per month). However, Abu Bakar should not able to booked room 1 for more than 5 times per month.

How can I write my query for above situation because I need to prepare SQL query for above so that it can help me to perform in my php if else statement?

Can someone assist me on this?
Note: As I know i agree there is insert, select, inner join and count involve but I just dont understand how to do the calculation for the date, place, and limitation for a user ID

7 Top Astrology APIs

Featured Imgs 23

We are all made of stars. So it's no wonder astrology is booming these days. Astrology is studying the influence that the placement of the sun, the moon, and the planets has on humans. It's a complicated endeavor, combining birthdays, zodiac signs, spirituality, star charts, orbits, and other outer world elements.

WordCamp Europe 2021 Gutenberg Demo: “The Block Editor Gets Ready to Become a Site Builder”

Category Image 091

Matt Mullenweg and Matías Ventura joined WordCamp Europe to chat about what’s happening with the Gutenberg project and celebrate the progress contributors have made over the past four years.

“For me, 2020 was the year that really felt like people started to see the vision of Gutenberg from four or five years ago, when it was very abstract and they saw it as kind of like the old WYSIWYG editor with some extra lines on it or something,” Mullenweg said. “The first 17 or 18 years of WordPress democratized people putting text into a box. Now we’re democratizing design, allowing people to control the boxes.”

Ventura commented on how transformative patterns have been for making page design approachable for users.

“Perhaps it was a smaller part of the roadmap initially but it’s becoming a centerpiece – especially because it allows…world class designers to provide a starting point for users and users get to learn design as they are interacting with themes,” Ventura said. He began his WordPress developer journey by “tinkering with themes,” as many others did, and believes that blocks can unlock a similar experimental learning experience.

“I think we are getting into a chapter where people will be able to tinker with things that were sort of hidden for you in WordPress – more advanced things like queries and loops, that we can now expose through blocks,” Ventura said. “They can be stepping stones for people to learn how to work with WordPress.”

Mullenweg commented on how things that previously would have required a fairly experienced WordPress developer to do, like creating a home page with a column that shows five recent posts from a particular category, and another column that shows featured posts in a different category, you can now do with just a few clicks.

“It’s no code – it’s like expanding the layers of accessibility of what people are able to do with WordPress,” Mullenweg said. “That, to me, is very core to our mission.”

Mullenweg and Ventura debuted a new “Gutenberg highlight” video that covers current and new features coming to the block editor, as it “gets ready to become a site builder.” These kinds of marketing videos are so valuable because users don’t always know what is possible, even if the tools are approachable for anyone to use.

The video demonstrates new design features for different blocks, including the transform live previews, dragging media into container blocks, inline cropping without leaving the editor canvas, the template editor, duotone image filters, more customization options for navigation, improvements to the list view browser, and the new global styles design that is coming soon.

Check out the video below and you can also watch Mullenweg and Ventura’s conversation that was recorded during the event.

Microphone issue – Samsung Tab A

Category Image 006

Microphone no longer works in apps after June Samsung update has been installed to the Samsung Tab A tablet. Tried changing mic permissions but same result. Is there a setting or something I can do so the microphone will work in Google Meet after the latest Samsung update has been applied to the tablet?

I have been able to do this for Zoom

  1. Open Zoom

  2. Settings -> Meeting

  3. Scroll down to "Use Original Audio" and make sure it is Toggled On

  4. While in the meeting select the three dots on the far right and click "Enable Original Audio."

A Progress Bar Block Plugin Done Right by the Tiles Team

Wp Plugins

I have been on the hunt for a decent progress bar solution for a while now. Most of them are bundled in large block libraries, requiring me to install another 20 or 30 blocks in which I have no need. Others seem to miss the mark entirely with odd configurations and block options. Some of the remaining plugins still use shortcodes and widgets, but it is 2021. I am looking for a block.

A couple of days ago, the Tiles Progress Block landed in the directory. It seems to be a smaller piece of a larger project named Tiles. I have been keeping an eye on the team’s work since its initial design and patterns framework plugin launched last week. That project is still in beta, and only time will tell if it becomes a competitive project in the block space.

However, the team’s new progress bar block was just what I was looking for. Other than one bug, which I reported to the developer, I found no serious issues.

The plugin does what it says on the tin. It registers a Progress Bar block:

Inserting both a Small and Large progress bar into the block editor.
Small and Large progress bars with default colors.

Out of the box, it includes Small and Large styles, allowing the user to adjust the size of the bar.

Its strength is that — I cannot stress this enough — the block’s content is editable within the editor canvas area. This includes the label and percentage. This is a refreshing change from the many others that require users to jump back into the block options sidebar to change simple text. Because the block uses Rich Text fields for its label and percentage, end-users can use inline formatting tools like bold, italic, and more.

The block also uses the standard typography and color palette controls from core WordPress. This provides access to the theme’s font sizes and colors.

Customizing the output of the Progress Bar Block in the WordPress editor with custom colors.
Adding custom labels, percentages, and colors.

Plus, users can choose wide and full-width layouts, an often overlooked feature in block plugins.

Overall, I am digging this block plugin. If I had one feature request, it would be to add a border-radius option. By default, the progress bar is rounded, but some users might prefer squared corners.

Extending the Block

In theme previews, I almost always see progress bars showcased alongside how much PHP, HTML, and JavaScript the demo’s faux developer has learned. It is rarely a real-world representation of progress bars. How do you quantify how much of a coding language you have mastered? I have been doing this for nearly two decades and cannot answer that.

Progress bars should be of measurable things. For example, steps someone has taken in an online learning course, percentage of total donations received, and any number of things that can be counted are far more realistic.

My favorite use of progress bars also happens to be on my favorite novelist’s website. I like to keep an eye on Brandon Sanderson’s work, looking forward to getting my next literary fix (yes, I am a fanboy).

Screenshot of the progress bars from Brandon Sanderson's website.
Brandon Sanderson’s writing progress.

Currently, Tiles Progress Block does not handle that exact layout. However, because it is built on the block system and does not do anything out of the ordinary, theme authors can change that with custom styles.

And that is just what I did. My Sanderson-esque book progress bars (rough, unpolished code available as a Gist):

Progress bars that move the percentage next to the bar.
Progress bars with custom block style.

The thing I love about the block system is that themers can extend blocks in this way. There is no needless checking for active plugins, loading additional per-plugin stylesheets, or figuring out each plugin’s unique system.

If a block is coded to the current standards, theme authors merely need to hook in with their own styles. Users can then select those styles via the editor and even make them the default.

I want to see more of this from the block plugin ecosystem.

Google’s Ads API V8 Gains Smart Bidding Functionality

Featured Imgs 23

Google has announced version 8 of its advertising API and is notifying developers that in order to take advantage of some of the release's new features, updating client libraries and code is necessary. This update includes new cross-account bidding strategies, improvement to sales tracking, and new label management options.

Boost Sales with Smart WordPress Site Navigation

Featured Imgs 26

Boost Sales with Smart WordPress Site NavigationYou might have a great marketing strategy, an attractive website, and a workforce with all the team skills necessary for running a successful business, but without a quality website, you’ll find yourself falling short of your sales goals. In today’s age of instant gratification, people have extremely short attention spans. There are plenty of affordable […]

The post Boost Sales with Smart WordPress Site Navigation appeared first on WPExplorer.

Equal Columns With Flexbox: It’s More Complicated Than You Might Think

Category Image 091

You get a nice-looking design handed to you and it has this nice big hero section, followed by one of those three-up columns right beneath it. You know, like almost every other website you’ve ever worked on.

You bang through the hero section and get to work on the three-column section. It’s time to pull out our trusty friend flexbox! Except, you write display: flex and you get this mess instead of getting the three equal columns you’d expect.

This happens because of how flexbox calculates the base size of an element. You’ve probably read lots of flexbox tutorials, and many of them (including my own) are an overly simplistic example of what flexbox does without really digging into the complex things that flexbox does for us that we take for granted.

I’m positive you’ve seen examples and tutorials that look at something like this, where three divs shrink down around the content that’s inside them:

In other words, we get some block-level elements shrinking down and slotting next to one another. It feels like flex wants things to be as small as possible. But in reality, flexbox actually wants things to be as big as possible.

Wait, what? Flex shrinks things by default — that can’t be right! Right?

As awesome as flexbox is, what it’s doing under the hood is actually a little strange because, by default, it is doing two things at once. It first looks at the content size which is what we would get if by declaring width: max-content on an element. But on top of that, flex-shrink is also doing some work allowing the items to be smaller, but only if needed.

To really understand what’s going on, let’s break those two down and see how they work together.

Diving into max-content

max-content is a pretty handy property value in certain situations, but we want to understand how it works in this particular situation where we are trying to get three seemingly simple equal columns. So let’s strip away flexbox for a moment and look at what max-content does on its own.

MDN does a good job of explaining it:

The max-content sizing keyword represents the intrinsic maximum width of the content. For text content this means that the content will not wrap at all even if it causes overflows.

Intrinsic might throw you off here, but it basically means we’re letting the content decide on the width, rather than us explicitly setting a set width. Uri Shaked aptly describes the behavior by saying “the browser pretends it has infinite space, and lays all the text in a single line while measuring its width.”

So, bottom line, max-content allows the content itself to define the width of the element. If you have a paragraph, the width of that paragraph will be the text inside it without any line breaks. If it’s a long enough paragraph, then you end up with some horizontal scrolling.

Let’s revisit that overly-simplistic example of three block-level elements that shrink down and slot next to one another. That isn’t happening because of flex-shrink; it’s happening because that’s the size of those elements when their declared width is max-content. That’s literally as wide as they go because that’s as wide as the combined content inside each element.

Here, take a look at those elements without flexbox doing it’s flexbox stuff, but with a width: max-content on there instead:

So, when there’s just a small amount of text, the intrinsic max-content shrinks things down instead of flex-shrink. Of course, flexbox also comes in with it’s default flex-direction: row behavior which turns the flex items into columns, putting them right next to one another. Here’s another look but with the free space highlighted.

Adding flex-shrink to the equation

So we see that declaring display: flex pushes that max-content intrinsic size on flex items. Those items want to be as big as their content. But there is another default that comes in here as well, which is flex-shrink.

flex-shrink is basically looking at all the flex items in a flexible container to make sure they don’t overflow the parent. If the flex items can all fit next to each other without overflowing the flexible container, then flex-shrink won’t do anything at all… it’s job is already done.

But if the flex items do overflow the container (thanks to that max-content intrinsic width thing), the flex items are allowed to shrink to prevent that overflow because flex-shrink is looking out for that.

This is why flex-shrink has a default value of 1. Without it, things would get messy pretty quickly.

Here’s why the columns aren’t equal

Going back to our design scenario where we need three equal columns beneath a hero, we saw that the columns aren’t equal widths. That’s because flexbox starts by looking at the content size of each flex item before even thinking about shrinking them.

Using Firefox’s DevTools (because it’s got some unique flexbox visualizations that others don’t), we can actually see how flexbox is calculating everything.

For simplicity’s sake, as we dive deeper into this, let’s work with some nice round numbers. We can do this by declaring widths on our flex items. When we declare a width on a flex item, we throw that intrinsic size out the window, as we’ve now declared an explicit value instead. This makes figuring out what’s really going on a lot easier.

In the Pen below, we have a parent that’s a 600px wide flexible container (display: flex). I’ve removed anything that might influence the numbers, so no gap or padding. I’ve also switched out the border for an outline so we can still visualize everything easily.

The first and third flex items have a width: 300px and the middle one a width: 600px. If we add that all up, it’s a total of 1200px. That’s bigger than the the 600px available within the parent, so flex-shrink kicks in.

flex-shrink is a ratio. If everything has the same flex-shrink (which is 1 by default), they all shrink at the same rate. That doesn’t mean they all shrink to the same size or by the same amount, but they all shrink at the same rate.

If we jump back into Firefox DevTools, we can see the base size, the flex-shrink and the final size. In this case, the two 300px elements are now 150px, and the 600px one is now 300px.

The two elements that have a base width of 300px become 150px.
The larger element with a base width of 600px becomes 300px.

If we add up all the base sizes of all three flex items (the actual widths we declared on them), the total comes out to 1200px. Our flex container is 600px wide. If we divide everything by 2, it fits! They are all shrinking by the same rate, dividing their own widths by 2.

It’s not often that we have nice round numbers like that in the real world, but I think this does a nice job illustrating how flexbox does what it does when figuring out how big to make things.

Getting the columns to be equal

There are a few different ways to get the three columns we want to be equal in width, but some are better than others. For all the approaches, the basic idea is that we want to get all the columns base size to be the same. If they have an equal base size, then they will shrink (or grow, if we use flex-grow) at an equal rate when flexbox does it’s flex things, and in theory, that should make them the same size.

There are a few common ways to do this, but as I discovered while diving into all of this, I have come to believe those approaches are flawed. Let’s look at two of the most common solutions that I see used in the wild, and I’ll explain why they don’t work.

Method 1: Using flex: 1

One way we can try to get all the flex items to have the same base size is by declaring flex: 1 on all of them:

.flex-parent { display: flex; }
.flex-parent > * { flex: 1; }

In a tutorial I made once, I used a different approach, and I must have had 100 people asking why I wasn’t using flex: 1 instead. I replied by saying I didn’t want to dive into the flex shorthand property. But then I used flex: 1 in a new demo, and to my surprise, it didn’t work.

The columns weren’t equal.

The middle column here is larger than the other two. It’s not by a ton, but the whole design pattern I’m creating is just so you have perfectly equal columns every single time, regardless of the content.

So why didn’t it work in this situation? The culprit here is the padding on the component in the middle column.

And maybe you’ll say it’s silly to add padding to one of the items and not the others, or that we can nest things (we’ll get to that). In my opinion, though, I should be able to have a layout that works regardless of the content that we’re putting in it. The web is all about components that we can plug and play these days, after all.

When I first set this up, I was sure it would work, and seeing this issue pop up made me want to learn what was really going on here.

The flex shorthand does more than just set the flex-grow: 1. If you don’t already know, flex is shorthand for flex-grow, flex-shrink, and flex-basis.

The default values for those constituent properties are:

.selector {
  flex-grow: 0;
  flex-shrink: 1;
  flex-basis: auto;
}

I’m not going to deep dive flex-basis in this article, as that’s something Robin has already done well. For now, we can think of it like width to keep things simple since we aren’t playing with flex-direction.

We’ve already seen how flex-shrink works. flex-grow is the opposite. If the size of all the flex items along the main axis is smaller than the parent, they can grow to fill that space.

So by default, flex items:

  • don’t grow;
  • if they would otherwise overflow the parent, they are allowed to shrink;
  • their width acts like max-content.

Putting that all together, the flex shorthand defaults to:

.selector {
  flex: 0 1 auto;
}

The fun thing with the flex shorthand is you can omit values. So, when we declare flex: 1, it’s setting the first value, flex-grow, to 1, which basically turns on flex-grow.

The strange thing here is what happens to the values that you omit. You’d expect them to stay at their defaults, but they don’t. Before we get to what happens, though, let’s first dive into what flex-grow even does.

As we’ve seen, flex-shrink allows elements to shrink if their base sizes add up to a computed value that’s bigger than the available width of the parent container. flex-grow is the opposite. If the grand total of the element base sizes is smaller than the value of the parent container’s width, then they will grow to fill the available space.

If we take that super basic example where we have three small divs next to one another and add flex-grow: 1, they grow to fill that leftover space.

But if we have three divs with unequal widths — like those ones we started with — adding flex-grow to them won’t do anything at all. They won’t grow because they’re already taking up all the available space —so much space, in fact, that flex-shrink needs to kick in and shrink them down to fit!

But, as folks have pointed out to me, setting flex: 1 can work to create equal columns. Well, sort of, as we saw above! In simple situations it does work though, as you can see below.

When we declare flex: 1 it works because, not only does this set the flex-grow to 1, but it also changes the flex-basis!

.selector {
  flex: 1;
  /* flex-grow: 1; */
  /* flex-shrink: 1; */
  /* flex-basis: 0%; Wait what? */
}

Yup, setting flex: 1 sets the flex-basis to 0%. This overwrites that intrinsic sizing we had before that behaved like max-content. All of our flex-items now want to have a base size of 0!

Looking at the expanded view of the flex: 1 shorthand in DevTools shows us that the flex-basis has changed to 0

So their base sizes are 0 now, but because of the flex-grow, they can all grow to fill up the empty space. And really, in this case, flex-shrink is no longer doing anything, as all the flex items now have a width of 0, and are growing to fill the available space.

FireFox’s DevTools showing an element with flex: 1 has a content size of 0 and is growing to fill the available space.

Just like the shrink example before, we’re taking the space that’s available, and letting all the flex items grow at an equal rate. Since they are all a base width of 0, growing at an equal rate means the available space is equally divided between them and they all have the same final size!

Except, as we saw, that’s not always the case…

The reason for this is because, when flexbox does all this stuff and distributes the space, whether it’s shrinking or growing a flex item, it’s looking at the content size of the element. If you remember back to the box model, we have the content size itself, then the padding, border, and margin outside of that.

And no, I didn’t forget * { box-sizing: border-box; }.

This is one of those strange quirks of CSS but it does make sense. If the browser looked at the width of those elements and included their padding and borders in the calculations, how could it shrink things down? Either the padding would also have to shrink or things are going to overflow the space. Both of those situations are terrible, so instead of looking at the box-size of elements when calculating the base size of them, it only looks at the content-box!

So, setting flex: 1 causes a problem in cases where you have borders or padding on some of your elements. I now have three elements that have a content-size of 0, but my middle one has padding on it. If we didn’t have that padding, we’d have the same math we did when we looked at how flex-shrink works.

A parent that is 600px and three flex items with a width of 0px. They all have a flex-grow: 1 so they grow at an equal rate, and they each end up 200px wide. But the padding mucks it all up. Instead, I end up with three divs with a content size of 0, but the middle one has padding: 1rem. That means it has a content size of 0, plus 32px padding as well.

We have 600 - 32 = 568px to divide equally, instead of 600px. All the divs want to grow at an equal rate, so 568 / 3 = 189.3333px.

And that’s what happens!

But… remember, that’s their content size, not the total width! That leaves us with two divs with a width of 189.333px, and another with a which of 189.333px + 32 = 221.333px. That’s a pretty substantial difference!

Method 2: flex-basis: 100%

I have always handled this like this:

.flex-parent {
  display: flex;
}

.flex-parent > * {
  flex-basis: 100%;
}

I thought this worked for the longest time. Actually, this was supposed to be my final solution after showing that flex: 1 doesn’t work. But while I was writing this article, I realized it also falls into the same problem, but it’s a lot less obvious. Enough so that I didn’t notice it with my eyes.

The elements are all trying to be 100% width, meaning they all want to match the width of the parent, which, again, is 600px (and in normal circumstances, is often much bigger, which further reduces the perceivable difference).

The thing is that 100% includes the padding in the computed values (because of * { box-size: border-box; }, which for the sake of this article, I’m assuming everyone is using). So, the outer divs end up with a content size of 600px, whereas the middle div ends up with a content size of 600 - 32 = 568px.

When the browser is working out how to evenly divide the space, it isn’t looking at how to evenly squish 1800px into a 600px space, but rather it’s looking at how to squish 1768px. Plus, as we saw earlier, flex items don’t shrink by the same amount, but at an equal pace! So, the element with padding shrinks slightly less in total than the others do.

This results in the .card having a final width of 214.483px while the others clock in at 192.75px. Again, this leads to unequal width values, though the difference is smaller than we saw with the flex: 1 solution.

Why CSS Grid is the better choice here

While all this is a little frustrating (and even a little confusing), it all happens for a good reason. If margins, padding, or borders changed sizes when flex gets involved, it would be a nightmare.

And maybe this means that CSS Grid might be a better solution to this really common design pattern.

I’ve long thought that flexbox was easier to pick up and start using than grid, but grid gives you more ultimate control in the long run, but that it’s a lot harder to figure out. I’ve changed my mind on that recently though, and I think not only does grid give us better control in this type of situation, but it’s actually more intuitive as well.

Normally, when we use grid, we explicitly declare our columns using grid-template-columns. We don’t have to do that though. We can make it behave a lot like flexbox does by using grid-auto-flow: column.

.grid-container {
  display: grid;
  grid-auto-flow: column;
}

Just like that, we end up with the same type of behavior as throwing display: flex on there. Like flex, the columns can potentially be unbalanced, but the advantage with grid is that the parent has total control over everything. So, rather than the content of the items having an impact like they would in flexbox, we only need one more line of code and we can solve the problem:

.grid-container {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

I love that this is all on the parent selector, and that we don’t have to select the children to help get the layout that we are after!

The interesting thing here is how fr units work. They are literally called flex units in the spec, and they work just like flexbox does in dividing up space;. The big difference: they’re looking at the other tracks to determine how much space they have, paying no attention to the content inside those tracks.

That’s the real magic here. By declaring grid-auto-columns: 1fr, we are in essence saying, “by default, all my columns should have an equal width,” which is what we’ve been after from the start!

But what about at small screens?

What I love with this approach is we can keep it super simple:

.grid-container {
  display: grid;
  gap: 1em;
}

@media (min-width: 35em) {
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

And just like that, it works perfectly. And by declaring display: grid from the start, we can include the gap to maintain equal spacing, whether the children are rows or columns.

I also find this to be a lot more intuitive than changing the flex-direction within a media query to get a similar result. As much as I love flexbox (and I really do still think it has great use cases), the fact that declaring flex-direction: column creates rows, and vice versa, is a little counter-intuitive at first glance.

And of course, if you prefer rolling without media queries, there is nothing stopping you from taking this to the next level with the help of auto-fit, which would be similar to setting something up with flex-wrap (though not exactly the same):

.grid-container {
  display: grid;
  gap: 1em;
  grid-template-columns: repeat(auto-fit, minmax(10em, 25em));
}

Making it work with flexbox

I realize that we can get around this with flexbox by nesting the element with the padding on it. We’ve done this since we started making layouts using floats, and Bootstrap really hammered home this type of design pattern.

<div class="container">
  <div class="row">
    <div class="col"> <div class="">... </div>
    <div class="col"> <div class="element-with-padding">...</div> </div>
    <div class="col"> ... </div>
  </div>
</div>

And there is nothing wrong with that. It works! But floats work too, and we’ve stopped using them for layouts as better solutions have been released in recent years.

One of the reasons that I love grid is because we can simplify our markup quite a bit. Just like we ditched floats for a better solution, I’d at least like to people to keep an open mind that maybe, just maybe, grid could be a better, and more intuitive solution for this type of design pattern.

Flexbox still has it’s place, of course

I still love flexbox, but I think its real power comes from times that we want to rely on the intrinsic width of the flex items, such as with navigations, or groups of elements, such as buttons or other items of varying width that you want to go next to one another.

In those situations, that behavior is an asset that makes things like even spacing between unequal items such a breeze! Flexbox is wonderful, and I have no plans to stop using.

In other situations though, when you find yourself fighting with how flexbox is trying to work, maybe you could turn to grid instead, even if it’s not a typical “2d” grid where you’re told you should be using it for.

People often tell me that they struggle to figure out grid because it’s too complicated, and while it can be, as we saw here, it doesn’t have to be.


The post Equal Columns With Flexbox: It’s More Complicated Than You Might Think appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

5 Top Ingredients for the Perfect Startup Pitch

Featured Imgs 23
5 Top Ingredients for the Perfect Startup Pitch

The prospect of meeting an investor makes the startup founder nervous a lot. It’s not a surprise. Since after a short conversation, you can provide your project with future or lose prospects. It all depends on the ability to present your idea effectively to investors.

If you’re raising money for your business, having an impressive pitch deck is a key component in your fundraising toolkit. A great pitch deck gets potential investors excited about your idea and engages them in a conversation about your business, hopefully leading to an investment.

In this article, we’re going to give you the recipe for what you should include in your own pitch deck. We’ve seen all different kinds of pitch decks and presentation styles and found that there’s a simple formula that just works.

What is a Pitch Deck?

A pitch deck, also known as a slide deck or start-up deck, is a presentation that provides a brief but informative overview of your business. It should cover the key points of your business plan, the products and services you provide, high-level financial projections, and funding needs. Your pitch deck should work well on its own as a visual document, but it will primarily be used as a tool to tell the story of your business.

There are several forms of pitch decks, like:

  • Elevator pitch conventionally lasts one minute, in practice even less: up to 30 seconds. This is a short presentation that could be given during an elevator ride.

  • Idea pitch is a different format, used in contests and events. This is a three-minute story in which you introduce yourself, talk about problems and their solutions, business model, market size.

  • Funding pitch lasts up to 10 minutes, in which you can supplement the presentation with a strategy, details of the current situation, plans and the amount of required investments.

What is the Purpose of a Pitch Deck?

The goal of your pitch deck is not to raise money. What? I know that doesn’t sound right, but the real goal of your pitch deck is to get to the next meeting.

Remember, your pitch deck and pitch presentation are probably some of the first things that an investor will see to learn more about your company. And because investments rarely are made after just one meeting, your goal is to spark interest in your company. You want investors to ask for more after they hear your pitch and not just show you to the door.

So, while a solid pitch deck is critical to raising money, the key goal of the deck is to get to the next step—another meeting and a request for more information.

5 Top Ingredients for the Perfect Startup Pitch

Ingredient # 1: Pitch Structure

This is the most crucial ingredient of the pitch. Why? Let's put it bluntly: you are the thousandth person investors will listen to. They do not have time and energy to listen to a hour long story about your business. The best thing to do is stick to the precise structure.

While every business is different, we’ve found that the following format works for most businesses and is most likely to generate interest from potential investors. Take a look at the major 11 slides you need to include in the structure of your own deck:

1. Vision and Value Proposition

This is a quick one-sentence overview of your business and the value that you provide to your customers. Keep it short and simple. A great way to think about this slide is to imagine it as a short tweet—describe your business in 140 characters or less in a way your parents would understand.

2. The Problem

If you aren’t solving some problem in the world, you are going to have a long uphill climb with your business. Use this slide to talk about the problem you are solving and who has the problem. You can talk about the current solutions in the market, but don’t spend too much time on the competitive landscape on this slide—you’ll have a chance to do that later on.

Ideally, try and tell a relatable story when you are defining the problem. The more you can make the problem as real as possible, the more your investors will understand your business and your goals.

3. Target Market and Opportunity

Use this slide to expand on who your ideal customer is and how many of them there are. What is the total market size and how do you position your company in the market? If you can find the data, investors will want to know how much people or businesses currently spend in the market to get a sense of the total market size. This is where you tell the story about the scope and scale of the problem you are solving.

4. The Solution

Finally, you get to dive into describing your product or service. Describe how customers use your product and how it addresses the problems that you outlined on slide two.

Most entrepreneurs are very focused on their product when instead they need to be focused on their customers and the problems those customers face. Try and keep your pitch deck focused with this format and you’ll tell a better story. If possible, use pictures and stories when you describe your solution. Showing is nearly always better than telling.

5. Revenue Model or Business Model

Now that you’ve described your product or service, you need to talk about how it makes money. What do you charge and who pays the bills? You can also reference the competitive landscape here and discuss how your pricing fits into the larger market. Are you a premium, high-price offering, or a budget offering that undercuts existing solutions on the market?

6. Traction and Validation

If you already have sales or early adopters using your product, talk about that here. Investors want to see that you have proven some aspect of your business model as that reduces risk, so any proof you have that validates that your solution works to solve the problem you have identified is extremely powerful.

7. Marketing and Sales Strategy

How are you planning on getting customers’ attention and what will your sales process look like? Use this slide to outline your marketing and sales plan. You’ll want to detail the key tactics that you intend to use to get your product in front of prospective customers. If your marketing and sales process is different than your competitors, it’s important to highlight that here.

8. Team

Why are you and your team the right people to build and grow this company? What experience do you have that others don’t? Highlight the key team members, their successes at other companies, and the key expertise that they bring to the table.

Even if you don’t have a complete team yet, identify the key positions that you still need to fill and why those positions are critical to company growth.

9. Financials

Investors will expect to see your financials: sales forecast, income statement (also called profit and loss statement), and cash flow forecast for at least three years. But, for your pitch deck, you shouldn’t have in-depth spreadsheets that will be difficult to read and consume in a presentation format. Limit yourself to charts that show sales, total customers, total expenses, and profits.

Remember to try and be realistic. Investors see “hockey stick” projections all the time and will mentally be cutting your projections in half. If you can explain your growth based on traction you already have or compared to a similar company in a related industry, that is extremely useful.

10. Competition

Even if you are opening up an entirely new market, your potential customers are using alternative solutions to solve their problems today. Describe how you fit into the competitive landscape and how you’re different than the competitors and alternatives that are on the market today.

11. Investment and Use of Funds

Finally, it’s time to actually ask for the money. That’s why you’re doing this pitch deck, right? I know—I said that this pitch deck isn’t about actually getting funded. That’s still true, but your potential investors do need to know how much money you are looking for.

More importantly, you need to be able to explain why you need the amount of money you are asking for and how you plan on using the money. Investors will want to know how their money is being used and how it is going to help you achieve the goals you are setting out for your business. If you already have some investors on board, now is when you should be talking about those other investors and why they chose to invest.

Ingredient # 2: Hooks

Just like we can count on the first few seconds of a first impression to be golden and unalterable, audiences are typically lost after about 5 minutes of a startup’s presentation. The audience’s attention curve is known to go up and down intermittently after the opening until a wrap-up’s final peak. Take this into account to keep investors motivated and interested.

The speaker should grab the audience's attention within the first minutes. In other cases, investors will be bored and won’t be able to focus on the idea of your pitch. For that, having an excellent hook as an attention-getter is the most effective business presentation opener.

There are no follow-through recipes to produce a great attention-getter. You need to find what will be natural for your business, whether it will be storytelling or putting yourself in the audience’s shoes. The better you can tailor your hooks to your specific business, the more powerfully your business presentation start will serve the purpose of captivating your audience.

Ingredient # 3: Design

If you're not a designer, it can be tough to design a compelling and beautiful presentation. Create a concise narrative that tells your business story and is backed by well-crafted slides.

1. Never Underestimate the Power of Strong Photography

Consider your slides as supporting material while you're presenting. You want the crowd to pay attention to you and your narrative and secondarily your presentation slides. Not the other way around.

Aim to keep to a single photo for each point you make. It's often enough supporting material for you to tell your story and get your message across. It's wise to keep text to the very minimum in your presentation. This ensures people are paying attention to you instead of getting distracted because you've overdone it with your slide designs.

2. Use the Right Colors, Contrast, and White Space

Color. Because design comes down to effective communication, you can understand the importance of colors and white space in your presentation deck design. This is why it's important to find color schemes that do the work for you. If your company has a style guide, use that as a foundation to pick the right colors. If not, you can use a website such as Adobe's Color, which has a nice selection of ready-made color themes.

Contrast. Contrast is something to keep in mind as well when designing the best pitch presentations. Make sure that your text is legible. You can assure this by having enough contrast between your slide background color (typically white or light-grey) and having an opposite text color (such as black for example).

White Space. Finally, you've got white space. The easiest way to deal with white space effectively is to give your slides enough breathing room. Simply put, don't put too many elements on a single slide. Give every element on a slide enough space. This makes your slide easier to digest. Otherwise, your slides will come across as unprofessional and disorganized. You'll just end up confusing your audience.

3. Say No to Animations

One of the trickier aspects of a slide design pitch deck to master is the use of animations. In general, the use of animations isn't recommended because:

  • They tend to slow your presentation, especially if you're adding a transition animation between each slide.

  • They tend to distract the audience while you're constructing an argument or story.

  • Finally, they might feel cheesy while you're pitching in a professional context (such as when asking for funding from potential investors).

4. Apply the Rule of Three

Another psychological trick is that people tend to remember everything better in pairs of three. This can be helpful while designing slides. If you're adding keywords or benefits or any other type of list on a slide, it works much better to summarize them in three elements (or add an extra one if you only have two). An example of applying the rule of three can be describing product benefits: a product that's beautiful, sustainable, and high-quality.

5. Convey a Single Message

When you're designing a pitch deck presentation, it's best to stick to a single message. Forcing yourself to focus on one message helps you to put all your energy into getting your point across clearly. Practically, this translates into the following:

  • What's the single message of my presentation as a whole?

  • What's the single message of my next slide?

Especially the last question—the message of your slide—helps you identify what the best possible design for your slide would be. The ideal slide design might be a few words, a strong photo, or perhaps even a single number. The easiest advice to apply is to simply use as little text as possible.

Ingredient # 4: Intelligible and expressive speech

If you are often asked to repeat the sentence or if you are asked to speak more slowly, then these are signals that your speech is not expressive enough. You can try the following tips:

  • Rehearse. There’s no easy way to go around this; you either rehearsed it, or you didn’t. And the major consideration there is, results truly show.

  • Keep eye contact. Most presenters have a hard time with eye contact. And mastering a presentation has a lot to do with eye contact, actually. It defines how you come across to your audience, keeping the public engaged and, ultimately, losing fear as you feel a grasp over the room in front of you.

  • Use your voice and speak up. Now, giving a presentation or speaking in front of an audience is all about being able to see and hear whoever is on stage. Make sure people can actually see and hear you. Tied a bit to confidence and your experience with being on stage as a whole, the volume with which one speaks is often the first thing over which we lose control as we attempt to speak in front of an audience.

  • Keep It Short & Simple. Keeping your presentations short and simple is one of the eldest pieces of advice. Though we need to go through a set amount of slides that make sense in the overall scope of what we’re doing, make sure to focus on the main message and the purpose why you are presenting; narrow down what your core message is, and let the rest speak on its own, if you can.

It's never to late to improve your public speaking skills:

Ingredient # 5: Explaining

This is perhaps one of the most difficult skills. Presenting your business idea you should be clear and concise while be able to explain the significance of it. This skill comes with training.

For example, you can train your pitches on the subway, right in the train car. During the trip, you should pretend to speak on the phone with the interlocutor, but your gaze will be directed at the passengers standing next to you or sitting opposite. Such a hack helps to develop not even one trick, but several. What it gives: the ability to talk about your project and make it clear, polish phrases and successful remarks, memorize the text, the skill to "look" at people.

Of course, for the purity of the experiment, we also recommend that you conduct rehearsals in front of real people or specialized consultants who, unlike passengers in the metro, are ready to listen to you. They will provide feedback on both content and behavior.

Top Examples of the Perfect Pitch Decks

AirBnB

Airbnb is a platform that allows people to list, find, and rent lodging. This company is one of the greatest startup success stories of our time. Airbnb’s pitch deck has become a most used reference for entrepreneurs around the world.

Favorite takeaway: The intro. It’s all about hooking your audience. You need to describe your business using as few words as possible. Imagine telling a 5-year-old what your business is about. If you can’t do that, it’s time to put some time into nailing it down.

Buffer

Buffer is a social media scheduling platform that helps you schedule content to Facebook, Twitter, LinkedIn, and Pinterest. The almighty startup pitch deck that helped Buffer to raise half a million dollars gained popularity by becoming one of the first pitch decks openly shared online. The founder decided to put it up to help other startups to raise funds.

Favorite takeaway: Similar to Facebook, the deck was based on solid numbers from Buffer’s users (e.g., 800 users, $150,000 annual revenue run rate, etc.)

Mixpanel

Mixpanel is an advanced analytics platform for mobile and the web. They not only measure page views but also analyze the actions people take. This is the series-B deck for Mixpanel that helped them raise over $65 million.

Favorite takeaway: The deck started off with a problem: people guessing their analytics. It followed up by providing their solution to that problem and, ultimately, their competitive advantage.

Start Developing Your Pitch Deck

We hope that the article was useful to you. You can also find plenty of additional advice visiting Slidebean. You’ll learn how to deliver an impactful elevator speech and find all the resources you need to perfect your pitch.

If you still have some questions or you are looking for a reliable tech partner to implement your idea into a robust software, drop us a line in a contact form and we will help you!

Build an Advanced Website with Total & Toolset

Featured Imgs 13

Build an Advanced Website with Total & ToolsetYou can build a completely advanced site without using many plugins and without having to code. The Total theme is now integrated with Toolset, which means you’ve got an entirely new set of professional features available to create any kind of powerful website you want. Total isn’t your average WordPress theme. Designed for ultimate flexibility, […]

The post Build an Advanced Website with Total & Toolset appeared first on WPExplorer.

Apple Launches ShazamKit for Audio Recognition Integrations

Featured Imgs 23

Prior to its purchase by Apple in 2017, Shazam had made quite the name for itself in the music recognition business. Hear a song but just don’t know the name? Shazam had your back. Once the company was gobbled up by Apple, this functionality found its way into iOS and has been ubiquitous ever since. 

target=blank

Category Image 052

Does that make your eye twitch a little bit? Like… it’s a typo. It should be target="_blank" with an underscore to start the value. As in…

<a target="_blank" href="https://codepen.io">
  Open CodePen in a New Tab
</a>

Welp, that’s correct syntax!

In the case of the no-underscore target="blank", the blank part is just a name. It could be anything. It could be target="foo" or, perhaps to foreshadow the purpose here: target="open-new-links-in-this-space".

The difference:

  • target="_blank" is a special keyword that will open links in a new tab every time.
  • target="blank" will open the first-clicked link in a new tab, but any future links that share target="blank" will open in that same newly-opened tab.

I never knew this! I credit this tweet explanation.

I created a very basic demo page to show off the functionality (code). Watch as a new tab opens when I click the first link. Then, subsequent clicks from either also open tab open that link in that new second tab.

Why?

I think use cases here are few and far between. Heck, I’m not even that big of a fan of target="_blank". But here’s one I could imagine: documentation.

Say you’ve got a web app where people actively do work. It might make sense to open links to documentation from within that app in a new tab, so they aren’t navigating away from active work. But, maybe you think they don’t need a new tab for every documentation link. You could do like…

<a target="codepen-documentation" 
  href="https://blog.codepen.io/documentation/">
  View CodePen Documentation
</a> 

<!-- elsewhere -->

<a target="codepen-documentation" 
  href="https://blog.codepen.io/documentation/">
  About Asset Hosting
</a>

The post target=blank appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.