Zachary Palmer

Zachary Palmer

1555901576

CSS Flexbox Tutorial | Build a Chat Application

Creating the conversation sidebar and main chat section

In this article we are going to focus on building a basic sidebar, and the main chat window inside our chat shell. See below.

Chat shell with a fixed width sidebar and expanded chat window

This is the second article in this series. You can check out the previous article for setting up the shell OR you can just check out the chat-shell branch from the following repository.

https://github.com/lyraddigital/flexbox-chat-app.git

Open up the chat.html file. You should have the following HTML.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Chat App</title>
    <link rel="stylesheet" type="text/css" media="screen" href="css/chat.css" />
</head>
<body>
    <div id="chat-container">
    </div>
</body>
</html>

Now inside of the chat-container div add the following HTML.

<div id="side-bar">
</div>
<div id="chat-window">
</div>

Now let’s also add the following CSS under the #chat-container selector in the chat.css file.

#side-bar {
    background: #0048AA;
    border-radius: 10px 0 0 10px;
}
#chat-window {
    background: #999;
    border-radius: 0 10px 10px 0;
}

Now reload the page. You should see the following:-

So what happened? Where is our sidebar and where is our chat window? I expected to see a blue side bar and a grey chat window, but it’s no where to be found. Well it’s all good. This is because we have no content inside of either element, so it can be 0 pixels wide.

Sizing Flex Items

So now that we know that our items are 0 pixels wide, let’s attempt to size them. We’ll attempt to try this first using explicit widths.

Add the following width property to the #side-bar rule, then reload the page.

width: 275px;

Hmm. Same result. It’s still a blank shell. Oh wait I have to make sure the height is 100% too. So we better do that too. Once again add the following property to the #side-bar rule, then reload the page.

height: 100%;

So now we have our sidebar that has grown to be exactly 275 pixels wide, and is 100% high. So that’s it. We’re done right? Wrong. Let me ask you a question. How big is the chat window? Let’s test that by adding some text to it. Try this yourself just add some text. You should see something similar to this.

So as you can see the chat window is only as big as the text that’s inside of it, and it is not next to the side bar. And this makes sense because up until now the chat shell is not a flex container, and just a regular block level element.

So let’s make our chat shell a flex container. Set the following display property for the #chat-window selector. Then reload the page.

display: flex;

So as you can see by the above illustration, we can see it’s now next to the side bar, and not below it. But as you can see currently it’s only as wide as the text that’s inside of it.

But we want it to take up the remaining space of the chat shell. Well we know how to do this, as we did it in the previous article. Set the flex-grow property to 1 on the #chat-window selector. Basically copy and paste the property below and reload the page.

flex-grow: 1;

So now we have the chat window taking up the remaining space of the chat shell. Next, let’s remove the background property, and also remove all text inside the chat-window div if any still exists. You should now see the result below.

But are we done? Technically yes, but before we move on, let’s improve things a little bit.

Understanding the default alignment

If you remember, before we had defined our chat shell to be a flex container, we had to make sure we set the height of the side bar to be 100%. Otherwise it was 0 pixels high, and as a result nothing was displayed. With that said, try removing the height property from the #side-bar selector and see what happens when you reload the page. Yes that’s right, it still works. The height of the sidebar is still 100% high.

So what happened here? Why do we no longer have to worry about setting the height to 100%? Well this is one of the cool things Flexbox gives you for free. By default every flex item will stretch vertically to fill in the entire height of the flex container. We can in fact change this behaviour, and we will see how this is done in a future article.

Setting the size of the side bar properly

So another feature of Flexbox is being able to set the size of a flex item by using the flex-basis property. The flex-basis property allows you to specify an initial size of a flex item, before any growing or shrinking takes place. We’ll understand more about this in an upcoming article.

For now I just want you to understand one important thing. And that is using width to specify the size of the sidebar is not a good idea. Let’s see why.

Say that potentially, if the screen is mobile we want the side bar to now appear across the top of the chat shell, acting like a top bar instead. We can do this by changing the direction flex items can flex inside a flex container. For example, add the following CSS to the #chat-container selector. Then reload the page.

flex-direction: column;

So as you can see we are back to a blank shell. So firstly let’s understand what we actually did here. By setting the flex-direction property to column, we changed the direction of how the flex items flex. By default flex items will flex from left to right. However when we set flex-direction to column, it changes this behaviour forcing flex items to flex from top to bottom instead. On top of this, when the direction of flex changes, the sizing and alignment of flex items changes as well.

When flexing from left to right, we get a height of 100% for free as already mentioned, and then we made sure the side bar was set to be 275 pixels wide, by setting the width property.

However now that we a flexing from top to bottom, the width of the flex item by default would be 100% wide, and you would need to specify the height instead. So try this. Add the following property to the #side-bar selector to set the height of the side bar. Then reload the page.

height: 275px;

Now we are seeing the side bar again, as we gave it a fixed height too. But we still have that fixed width. That’s not what we wanted. We want the side bar (ie our new top bar) here to now be 100% wide. Comment out the width for a moment and reload the page again.

So now we were able to move our side bar so it appears on top instead, acting like a top bar. Which as previously mentioned might be suited for mobile device widths. But to do this we had to swap the value of width to be the value of height. Wouldn’t it be great if this size was preserved regardless of which direction our items are flexing.

Try this, remove all widths and height properties from the #side-bar selector and write the following instead. Then reload the page.

flex-basis: 275px;

As you can see we get the same result. Now remove the flex-direction property from the #chat-container selector. Then once again reload the page.

Once again we are back to our final output. But now we also have the flexibility to easily change the side bar to be a top bar if we need to, by just changing the direction items can flow. Regardless of the direction of flex, the size of our side bar / top bar is preserved.

Conclusion

Ok so once again we didn’t build much, but we did cover a lot of concepts about Flexbox around sizing. 

#css #programming #webdev 

Testo Ultra

1618818497

Testoultra Price In India - Best Supplement To Boost Your Testosterone Level!

Testoultra is a popular and promising testosterone booster supplement that is available online on the official website. The biggest discount price available online on the official website, which has a retail price of $99.94 USD.
Testoultra Price In India with discount is $55.95 or INR 3630
You should order it online at the official website to check current prices & offer.

• Get Starter package that gives two 2 months’ supply- ₹2,650 for each bottle
• Get Pro results package that gives two 6 months’ supply- ₹1,450 each bottle
• Get Pump up package that gives two 4 months’ supply- ₹1,950 each bottle

For More About The Product, You Can Visit Here:

https://testoultracapsuleusa.blogspot.com/2021/04/testoultra-dosage-how-to-use-testoultra.html
https://testoultracapsuleusa.blogspot.com/2021/04/testoultra-price-in-india-what-are.html

#testoultra price in india #testoultra review #testoultra price #testoultra side effects #testoultra how to use #testoultra ingredients

ClientFinda Review - Recommended or Not?

### ClientFinda Review

Do you have trouble attracting clients? You’re not by yourself.
Starting a business is not difficult, but growing a business can be difficult over time. The reason for this is that you require consistent cash flow.
Cash flow failure is one of the leading causes of failure in fast-growing businesses.

Sometimes an exciting increase in sales outpaces your ability to finance it. This is particularly difficult because you have become a victim of your own success.
Plan carefully for expansion, and especially ensure that you have solid sources of funding to support your expansion before it occurs. At the very least, if you over-plan and sales don’t skyrocket to the level you anticipated, you won’t be financially embarrassed.
And the only way to have consistent cash flow is to have customers who will pay for your goods or services.
Obtaining quality clients can be a real pain in the neck for your company.
I’ll show you the best way to find them, as well as the best tactics and system to employ.
According to statistics;

Only about 20% of new businesses survive their first year in business.

In the first five years, half of all small businesses fail.

These statistics can be frightening, whether you’re a seasoned small business owner or a first-time entrepreneur.
You’ve come to the right place if you want to get quality clients for your business, no matter what niche you serve or whether it’s a service or product-based business. Then get ready for the new ClientFinda App, which will go live on July 22nd, 2021.
Based on the positive buzz surrounding this software, I decided to conduct an in-depth review. ClientFinda is a game-changing platform… very much needed… and solves a HUGE problem for your company.
We’ll go over how it works, who it’s for, how much it costs, the incredible bonuses, the upsells, and the pros and cons of this new tool so you can make an informed purchase decision… and, of course, whether it is appropriate for you.
First,
What Exactly Is ClientFinda?
ClientFinda combines the power of Artificial Intelligence (AI), Natural Language Processing (NLP), and Machine Learning (ML) to conduct a deep search for quality buyer leads in ANY niche.
All you have to do is answer a few questions and you’re done…
The ClientFinda AI wizard generates laser-targeted and pre-qualified buyer leads that are ONLY interested in your services and have specific requirements.
How Does It Operate?
Client Finda can be set up to work for you in three simple steps.
Step 1: Enter Your Audience Filters for Your Target Audience (Location, Niche, Social Media Presence, Online Reviews etc.)
Step 2: Look at the companies that are most likely to buy your services.
(AI, NLP, and ML powered results… ensuring 99.99 percent accuracy)
Step 3: Contact the clients who are most likely to purchase your services so that you don’t waste time and money on dead leads.
Who Is It Intended For?
works in the following fields:

Realtors and real estate

Ecommerce

Listings on Airbnb

Automobile Sales

Recreation and travel

Computer games

Music and film

Retail and online shopping

Education

Video Promotion

EVERYONE

Whatever your audience type is-SMM, Content Marketing, Website Builder, Paid Ads, Email Marketing, SEO, Ecommerce, Traffic, Agency & MMO, and so on.
This offer is ideal for you because EVERYONE requires buyer leads.
ClientFinda Advantages
You can discover whether or not your potential lead is running ads, as well as the type of ad they are running. The identification of ad mediums is done for you across platforms—Facebook, Messenger, Instagram, Adwords…
You can then reach out to them with ready-to-use ads OR an ad service proposal if they don’t run ads at all based on their brand needs and preferences!
You will be able to provide the following services to your customers:

GMB Standing

They haven’t yet created a Google My Business listing? Great, now is your chance to jump right in and save the day!

Google PageRank

How high does your company rank on Google? Does the website make good use of optimization? If not, sell them on your knowledge.

Advertisement Pixels

Do they have ineffective advertisements? As soon as you connect with them, sell high-converting ads to them, almost as if you could read their minds!

Google Analytics is a web analytics service.

Determine whether or not your lead is using Google Analytics to track and grow their brand on their website.
If not, step in to save the day and get paid for it.

Markdown Schema

Find websites that do not use schema markup and contact them so you can offer them your services and charge them top dollar for them.

Linkedin Page

Find out if the company has an existing LinkedIn profile, as well as information about their connections…

Facebook Page

Determine whether the company has a Facebook account, as well as statistics such as page likes, posts, and activity…

Twitter

Check to see if the company is on Twitter… with information such as the number of followers, tweets, and retweets!

What is the cost?
Incredibly, and this is one of the aspects of this offer that fascinates me…
ClientFinda and all of the awesome bonuses are available for a TINY one-time fee of $37… Can you outdo that?
That is a very small fraction of its true value, market cost, and income potential!
Furthermore, this small investment is backed by a solid ZRO RISK 14-day money-back guarantee, allowing you to test run the software with no risk on the part of the product creator.
However, keep in mind that this low one-time fee is only valid during the launch special period. DON’T MISS OUT!
What Exactly Are the Upsells?
ClientFinda PRO-$67/month is the first upsell.
Users can conduct UNLIMITED searches, generate UNLIMITED leads, close UNLIMITED clients, and profit UNLIMITEDly for a low one-time fee!

Upsell 2: $67 for Outreachr-AI Cold Email Writer.

Outreachr is a fully automated lead communication system powered by AI.

$97 for DFY Digital Marketing Services
Get Instant Access to TEN Full-Blown Digital Marketing Service Kits and start offering in-demand digital marketing services to your NEW & EXISTING clients.

Resellify + ClientFinda Reseller-$97, $297
RESELL the CleintFinda app under your own name and KEEP 100% of the profit. Selling software products is a simple way to make money.
Plus…
Get Reseller Rights to FIVE High-Quality Software Apps, as well as Professionally Designed Sales Pages and Marketing Materials.
PROS AND CONS
The benefits are obviously numerous, but I’ll only mention a few:

Increased conversions are guaranteed.

Innovative technology

The greatest possible global reach

It is extremely simple to use.

It is simple to set up.

EVERYONE NEEDS A MASS APPEAL SOLUTION!

EVERY COMPANY’S LIFELINE IS LEAD GENERATION.

Cons:

The Funnel is quite deep; there are four separate upgrade options: this isn’t much of a con because the software works perfectly without any of the upgrades.

You will require a strong internet connection.

WORDS TO REMEMBER
To summarize, if you want to keep your business running without worrying about not having enough clients or running out of cash, ClientFinda is your best friend.
As a result, on this note, I’ll say that ClientFinda is a timely solution that I strongly recommend.
Without a doubt, I rate it a five-star rating. Anything else will be labeled “BIAS!”
You may proceed to secure your access. Your investment is both SAFE and WISE. Cheers!

#clientfinda review #clientfinda review and bonus #clientfinda review bonus demo #clientfinda review bonus #clientfinda review demo #clientfinda reviews

David mr

David mr

1624312800

SPORE FINANCE PREDICTION - WHAT IS SPORE FINANCE & SPORE FINANCE ANALYSIS - SPORE FINANCE

SPORE FINANCE PREDICTION - WHAT IS SPORE FINANCE & SPORE FINANCE ANALYSIS - SPORE FINANCE

In this video, I talk about spore finance coin and give my spore finance prediction. I talk about the latest spore finance analysis & spore finance crypto coin that recently has been hit pretty hard in the last 24 hours. I go over what is spore finance and how many holders are on this new crypto coin spore finance.
📺 The video in this post was made by Josh’s Finance
The origin of the article: https://www.youtube.com/watch?v=qbPQvdxCtEI
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----CLICK HERE-----**⭐ ⭐ ⭐
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!

#bitcoin #blockchain #spore finance #what is spore finance #spore finance prediction - what is spore finance & spore finance analysis - spore finance #spore finance prediction