Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 7374

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 28, 20242024-11-28T03:13:08+00:00 2024-11-28T03:13:08+00:00

Styling the featured work section – part 7

  • 60k

Now that we have the recent post section let's look at the last bit of the homepage. This will be the featured work section.

Design featured work section

The design shows us the following element. We can see some outlined items here:

  • The section header we created yesterday
  • Work sections

Styling the featured work section

Let's start by creating a new component called featuredWork.js, and inside we can bootstrap a very generic component.

import SectionHeader from './sectionHeader';  export default function FeaturedWork() {   return (     <section className='px-6'>       <div className='max-w-4xl mx-auto py-12'>         <SectionHeader title='Featured work' href='#' />       </div>     </section>   ); } 
Enter fullscreen mode Exit fullscreen mode

You can see we can reuse the header we made yesterday. Now that's convenience.

Let's import this file to our homepage.

import Head from 'next/head'; import IntroHeader from '../components/introHeader'; import RecentPosts from '../components/recentPosts'; import FeaturedWork from '../components/featuredWork';  export default function Home() {   return (     <div>       <Head>         <title>NextJS Portfolio</title>         <meta name='description' content='Generated by create next app' />         <link rel='icon' href='/favicon.ico' />       </Head>       <IntroHeader />       <RecentPosts />       <FeaturedWork />     </div>   ); } 
Enter fullscreen mode Exit fullscreen mode

From here, let's focus on adding the article components.
We'll create the work.js file and place the main markup inside.

export default function Work() {   return (     <article>       <img src='https://via.placeholder.com/240' />       <div>         <h3>Work title</h3>         <span>           <date>2022</date> Tagname         </span>         <p>           Amet minim mollit non deserunt ullamco est sit aliqua dolor do amet           sint. Velit officia consequat duis enim velit mollit. Exercitation           veniam consequat sunt nostrud amet.         </p>       </div>     </article>   ); } 
Enter fullscreen mode Exit fullscreen mode

Let's start by adding two of these to our featuredWork component so we can see what's going on.

import SectionHeader from './sectionHeader'; import Work from './work';  export default function FeaturedWork() {   return (     <section className='px-6'>       <div className='max-w-4xl mx-auto py-12'>         <SectionHeader title='Featured work' href='#' />         <div className='flex flex-col gap-2'>           <Work />           <Work />         </div>       </div>     </section>   ); } 
Enter fullscreen mode Exit fullscreen mode

I already added a wrapping div with some classes to space them out a bit better.
Resulting in the following:

Featured work unstyled

Let's start by adding some styling to this.
First up is the wrapping element.

<article className="flex items-center border-b-2 py-6"></article> 
Enter fullscreen mode Exit fullscreen mode

As for the image, we can always set its width to be 1/3rd of the wrapper.

<img src="https://via.placeholder.com/240" className="w-1/3 mr-6 rounded-lg" /> 
Enter fullscreen mode Exit fullscreen mode

Now on to the text elements starting with the title, which is the same as the one we used for the posts.

Note: You can also convert this into a custom heading component.

<h3 className="text-2xl mb-2 font-medium"></h3> 
Enter fullscreen mode Exit fullscreen mode

As for the date and text, we use the wrapping div to style the tag and the date tag to create the little pill-like year.

<span className="text-gray-600 mb-4 block">   <date className="bg-blue-800 text-white px-5 py-1.5 mr-4 rounded-xl">     2022   </date>   Dashboard </span> 
Enter fullscreen mode Exit fullscreen mode

And that's it!
Let's take a look at the result for today.

Styled featured work section

You can also find the completed code on GitHub.

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

beginnersjavascriptnextjswebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 1k
  • Popular
  • Answers
  • Author

    How to ensure that all the routes on my Symfony ...

    • 0 Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.