I have a dropdown menu inside one of the columns in a table. When it is exposed, it is either cut off (overflow-hidden) or created a scroll bar (overflow-visible).
How would I get this to just appear over top of the table (or "extend" a parent div so it's all visible) so that the only scroll bar is the usual one in the browser, not this table-specific scroll bar. Code provided below.
<div class="flex flex-col">
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
<div class="shadow border-b border-gray-200 sm:rounded-lg overflow-auto">
<div class="flex flex-wrap m-4 justify-between">
<div class="flex items-center">
<div class="beep-label">
#lang('livewire.per_page'):
</div>
<select wire:model="perPage" class="beep-input align-middle w-auto inline-block">
<option>10</option>
<option>15</option>
<option>25</option>
</select>
</div>
<div class="flex">
<div class="beep-label pr-2 flex justify-center items-center h-full text-center">
#lang('one-word.filter'):
</div>
<input wire:model="search" class="beep-input" type="text" placeholder="#lang('livewire.search_users')...">
</div>
</div>
<table class="divide-y divide-gray-200 w-full">
<thead>
<tr>
<th class="beep-table-header h-full align-middle flex">
<div class="align-middle justify-items-auto">
<a wire:click.prevent="sortBy('name')" role="button" href="#" class="">
#include('livewire.includes._sort-icon', ['field' => 'name'])
<div class="inline-block">#lang('one-word.name')</div>
</a>
</div>
</th>
<th class="beep-table-header">
<a wire:click.prevent="sortBy('users.email')" role="button" href="#" class="">
#include('livewire.includes._sort-icon', ['field' => 'users.email'])
#lang('users.beep_email')
</a>
</th>
<th class="beep-table-header">
<a wire:click.prevent="sortBy('beep_extension')" role="button" href="#" class="">
#include('livewire.includes._sort-icon', ['field' => 'beep_extension'])
#lang('livewire.beep_ext')
</a>
</th>
<th class="beep-table-header text-center">
#lang('one-word.action')
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
#foreach ($contacts as $contact)
<tr #if ($contact->is_active !== true) class="table-danger" #endif>
<td class="px-6 py-4 whitespace-no-wrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
#if ($contact->contactable->thumbnail)
<img class="h-10 w-10 rounded-full"
src="{{ $contact->contactable->thumbnail }}"
alt="">
#else
<x-nav.svg-icons icon="user-circle" class="w-3 h-3" />
#endif
</div>
<div class="ml-4">
<div class="text-sm leading-5 font-medium text-gray-900">
{{ $contact->name }}
</div>
<div class="text-sm leading-5 text-gray-500">{{ $contact->contactable->email }}</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-no-wrap">
<div class="text-sm leading-5 text-gray-900">{{ $contact->beep_mail }}</div>
</td>
<td class="px-6 py-4 whitespace-no-wrap">
<div class="text-sm leading-5 text-gray-900">{{ $contact->beep_extension }}</div>
</td>
<td class="px-6 py-4 whitespace-no-wrap text-center text-sm leading-5 font-medium">
<div x-data="{ open: false }" #keydown.window.escape="open = false" #click.away="open = false" class="relative inline-block text-left">
<div>
<span class="rounded-md shadow-sm">
<button #click="open = !open" type="button" class="inline-flex justify-center w-full rounded-md border border-gray-300 px-4 py-2 bg-white text-sm leading-5 font-medium text-gray-700 hover:text-gray-500 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-50 active:text-gray-800 transition ease-in-out duration-150" id="options-menu" aria-haspopup="true" aria-expanded="true">
#lang('one-word.action')
<!-- Heroicon name: chevron-down -->
<svg class="-mr-1 ml-2 h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
</svg>
</button>
</span>
</div>
<div x-show="open" x-description="Dropdown panel, show/hide based on dropdown state." x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg z-10">
<div class="rounded-md bg-white shadow-xs">
<div class="py-1" role="menu" aria-orientation="vertical" aria-labelledby="options-menu">
#can ('view', $contact->contactable)
#lang('users.view_profile')
#endcan
#can ('update', $contact->contactable)
#lang('one-word.edit')
#lang('livewire.edit_contact_methods')
{{ $contact->is_active ? __('one-word.deactivate') : __('one-word.activate') }}
#endcan
</div>
</div>
</div>
</div>
</td>
</tr>
#endforeach
</tbody>
</table>
<div class="p-2 uppercase text-sm bg-gray-200">
{{ $contacts->links() }}
</div>
</div>
</div>
</div>
</div>
And the extracted css components in case they are helpful:
.beep-label {
#apply block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2;
}
.beep-input {
#apply appearance-none block w-full text-gray-700 border border-gray-500 rounded py-1 px-2 mb-3;
}
.beep-table-header {
#apply px-6 py-3 bg-gray-100 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider;
}
Related
I have a responsiveness issue with the project that I am currently developing
I have a sidebar with two nested divs (the sections that appear "separated" from each other - see preview below) with absolute positioning that are overlapping each other whenever the screen height is lower than the space required to fit all of the elements on screen.
Overlapping Elements
I would like to know how to stop the bottom section from overlapping the top section and make the sidebar's content scrollable from that point (once the "SOUND DETECTION DETAILS" container begins to overlap the "STROBE DURATION" container).
Here's the relevant index.html body section code:
<body class="bg-black">
<div id="sidebar">
<div id="sidebar-container" class="py-1.5 bg-gray-300 w-400px h-full absolute z-1 overflow-x-hidden opacity-100">
<div id="sidebar-logo" class="w-[300px] mx-auto">
<img class="" src="assets\img\logo-V2\logo-horizontal-black.png">
</div>
<hr class="w-[375px] border border-solid border-zinc-700 mx-auto">
<h3 class="text-center py-3 text-xl text-gray-600 font-semibold">STROBE SYNC MODE</h3>
<div id="auto-manual-container" class="w-[330px] ml-35px flex justify-between">
<button id="auto" class="w-[150px] h-10 mb-4 bg-white rounded font-bold text-xl text-themeOrange selected" onclick="autoMode()">AUTO</button>
<button id="manual" class="w-[150px] h-10 mb-4 bg-white rounded font-bold text-xl text-gray-700" onclick="manualMode();">MANUAL</button>
</div>
<hr class="w-[375px] border border-solid border-zinc-700 mx-auto">
<div id="auto-mode-container" class=""> <!-- "AM" stands for "Auto Mode" -->
<div id="input-device-container" class="w-[330px] ml-35px">
<h5 class="mt-3 mb-1 font-semibold text-sm text-gray-500">INPUT DEVICE</h5>
<select id="select-input-device" class="w-full h-10 mb-5 flex mx-auto bg-white rounded outline-none font-semibold text-center text-gray-700" required>
<option value="" selected disabled hidden>SELECT DEVICE</option>
<option value="" class="device text-left"> Integrated Player</option>
<option value="" class="device text-left"> Example Device</option>
</select>
</div>
<div id="frequency-range-focus-container" class="w-[330px] ml-35px">
<h5 class="mt-3 mb-1 font-semibold text-sm text-gray-500">FREQUENCY RANGE FOCUS</h5>
<div id="low-mid-high-container" class="w-full flex justify-between">
<button id="low" class="w-[100px] h-6 mb-4 pt-[2px] bg-white rounded font-bold text-base text-themeOrange selected" onclick="low_Btn()">LOW</button>
<button id="mid" class="w-[100px] h-6 mb-4 pt-[2px] bg-white rounded font-bold text-base text-gray-700" onclick="mid_Btn()">MID</button>
<button id="high" class="w-[100px] h-6 mb-4 pt-[2px] bg-white rounded font-bold text-base text-gray-700" onclick="high_Btn()">HIGH</button>
</div>
<button id="master" class="w-full h-12 mb-3 pt-[2px] bg-white rounded font-bold text-base text-gray-700" onclick="master_Btn()">MASTER</button>
</div>
<div id="detection-sensitivity-container" class="w-[330px] ml-35px">
<h5 id="sens-label" class="mt-3 mb-1 font-semibold text-sm text-gray-500"></h5>
<div id="sens-slider-container" class="w-full">
<input type="range" min="0" max="100" value="50" class="sens-slider w-full" id="sens-slider">
<p class="float-left font-regular text-sm text-gray-600">0</p>
<p class="float-right font-regular text-sm text-gray-600">100</p>
</div>
</div>
<br>
<div id="strobe-duration-container" class="w-[330px] ml-35px">
<h5 id="AM-duration-label" class="mt-3 mb-1 font-semibold text-sm text-gray-500"></h5>
<div id="duration-slider-container" class="duration-slider-container">
<input type="range" min="10" max="1000" value="200" class="duration-slider w-full" id="AM-duration-slider">
<p class="float-left font-regular text-sm text-gray-600">10</p>
<p class="float-right font-regular text-sm text-gray-600">1000</p>
</div>
</div>
<br>
<div id="sound-detection-details-container" class="w-[330px] ml-35px absolute bottom-[75px]">
<h5 class="mt-3 mb-1 font-semibold text-sm text-gray-500">SOUND DETECTION DETAILS</h5>
<div id="SDD-container" class="w-full h-40 px-4 bg-white rounded flex flex-col justify-evenly">
<div id="SCT-container" class="w-full">
<h4 class="float-left font-semibold text-base text-gray-600">SOUND COME THROUGH</h4>
<label id="SCT-check-container" class="float-right">
<input type="checkbox" checked disabled> <!-- only check when audio coming trough, change with javascript -->
<span class="SCT-checkmark"></span>
</label>
</div>
<hr>
<div id="tempo-container" class="w-full">
<h4 class="float-left font-semibold text-base text-gray-600">TEMPO:</h4>
<h4 id="bpm" class="float-right font-semibold text-base text-gray-600">150BPM</h4> <!-- change with javascript -->
</div>
<hr>
<div id="audio-meter-container" class="w-full">
<h4 class="float-left font-semibold text-base text-gray-600">AUDIO METER</h4>
<label id="AM-check-container" class="float-right"><!-- in this context "AM" stands for "Audio Meter" -->
<input type="checkbox">
<span class="AM-checkmark"></span>
</label>
</div>
</div>
</div>
<br>
<div id="AM-on-off-container" class="w-[330px] ml-35px flex justify-between absolute bottom-0">
<button id="AM-off" class="w-[150px] h-10 mb-4 bg-white rounded font-bold text-xl text-themeOrange selected" onclick="AM_turnOff()">OFF</button>
<button id="AM-on" class="w-[150px] h-10 mb-4 bg-white rounded font-bold text-xl text-gray-700" onclick="AM_turnOn();">ON</button>
</div>
</div>
</div>
</div>
</body>
I am using Tailwind CSS, however, I do understand pure CSS answers as i am able to convert them to Tailwinds fromatting. Thanks!
I have searched for hours trying to find a solution for a problem similar to mine, but with no avail. I have found tutorials with a context similar to mine but the elements' positioning were not of the same type.
I had tried to remove the absolute position of the divs encapsulating sound detection details and also refactored some of the code . Below is the code shared.
<script src="https://cdn.tailwindcss.com"></script>
<body class="bg-black">
<div id="sidebar">
<div id="sidebar-container" class="py-1.5 bg-gray-300 w-400px h-full absolute z-1 overflow-x-hidden opacity-100 overflow-y-scroll flex-col justify-center items-center">
<div id="sidebar-logo" class="w-[300px] mx-auto">
<img class="" src="assets\img\logo-V2\logo-horizontal-black.png">
</div>
<hr class="w-[375px] border border-solid border-zinc-700 mx-auto">
<h3 class="text-center py-3 text-xl text-gray-600 font-semibold">STROBE SYNC MODE</h3>
<div id="auto-manual-container" class="w-[330px] mx-[35px] flex justify-between">
<button id="auto" class="w-[150px] h-10 mb-4 bg-white rounded font-bold text-xl text-themeOrange selected" onclick="autoMode()">AUTO</button>
<button id="manual" class="w-[150px] h-10 mb-4 bg-white rounded font-bold text-xl text-gray-700" onclick="manualMode();">MANUAL</button>
</div>
<hr class="w-[375px] border border-solid border-zinc-700 mx-auto">
<!-- "AM" stands for "Auto Mode" -->
<div id="input-device-container" class="w-[330px] mx-[35px]">
<h5 class="mt-3 mb-1 font-semibold text-sm text-gray-500">INPUT DEVICE</h5>
<select id="select-input-device" class="w-full h-10 mb-5 flex mx-auto bg-white rounded outline-none font-semibold text-center text-gray-700" required>
<option value="" selected disabled hidden>SELECT DEVICE</option>
<option value="" class="device text-left"> Integrated Player</option>
<option value="" class="device text-left"> Example Device</option>
</select>
</div>
<div id="frequency-range-focus-container" class="w-[330px] mx-[35px]">
<h5 class="mt-3 mb-1 font-semibold text-sm text-gray-500">FREQUENCY RANGE FOCUS</h5>
<div id="low-mid-high-container" class="w-full flex justify-between">
<button id="low" class="w-[100px] h-6 mb-4 pt-[2px] bg-white rounded font-bold text-base text-themeOrange selected" onclick="low_Btn()">LOW</button>
<button id="mid" class="w-[100px] h-6 mb-4 pt-[2px] bg-white rounded font-bold text-base text-gray-700" onclick="mid_Btn()">MID</button>
<button id="high" class="w-[100px] h-6 mb-4 pt-[2px] bg-white rounded font-bold text-base text-gray-700" onclick="high_Btn()">HIGH</button>
</div>
<button id="master" class="w-full h-12 mb-3 pt-[2px] bg-white rounded font-bold text-base text-gray-700" onclick="master_Btn()">MASTER</button>
</div>
<div id="detection-sensitivity-container" class="w-[330px] mx-[35px]">
<h5 id="sens-label" class="mt-3 mb-1 font-semibold text-sm text-gray-500"></h5>
<div id="sens-slider-container" class="w-full">
<input type="range" min="0" max="100" value="50" class="sens-slider w-full" id="sens-slider">
<p class="float-left font-regular text-sm text-gray-600">0</p>
<p class="float-right font-regular text-sm text-gray-600">100</p>
</div>
</div>
<br>
<div id="strobe-duration-container" class="w-[330px] mx-[35px]">
<h5 id="AM-duration-label" class="mt-3 mb-1 font-semibold text-sm text-gray-500"></h5>
<div id="duration-slider-container" class="duration-slider-container">
<input type="range" min="10" max="1000" value="200" class="duration-slider w-full" id="AM-duration-slider">
<p class="float-left font-regular text-sm text-gray-600">10</p>
<p class="float-right font-regular text-sm text-gray-600">1000</p>
</div>
</div>
<br>
<div id="sound-detection-details-container" class=" w-[330px] mt-28 mx-[35px] bottom-[75px]">
<h5 class="mt-3 mb-1 font-semibold text-sm text-gray-500">SOUND DETECTION DETAILS</h5>
<div id="SDD-container" class="w-full h-40 px-4 bg-white rounded flex flex-col justify-evenly">
<div id="SCT-container" class="w-full">
<h4 class="float-left font-semibold text-base text-gray-600">SOUND COME THROUGH</h4>
<label id="SCT-check-container" class="float-right">
<input type="checkbox" checked disabled> <!-- only check when audio coming trough, change with javascript -->
<span class="SCT-checkmark"></span>
</label>
</div>
<hr>
<div id="tempo-container" class="w-full">
<h4 class="float-left font-semibold text-base text-gray-600">TEMPO:</h4>
<h4 id="bpm" class="float-right font-semibold text-base text-gray-600">150BPM</h4> <!-- change with javascript -->
</div>
<hr>
<div id="audio-meter-container" class="w-full">
<h4 class="float-left font-semibold text-base text-gray-600">AUDIO METER</h4>
<label id="AM-check-container" class="float-right"><!-- in this context "AM" stands for "Audio Meter" -->
<input type="checkbox">
<span class="AM-checkmark"></span>
</label>
</div>
</div>
</div>
<br>
<div id="AM-on-off-container" class=" w-[330px] mx-[35px] flex justify-between bottom-0">
<button id="AM-off" class="w-[150px] h-10 mb-4 bg-white rounded font-bold text-xl text-themeOrange selected" onclick="AM_turnOff()">OFF</button>
<button id="AM-on" class="w-[150px] h-10 mb-4 bg-white rounded font-bold text-xl text-gray-700" onclick="AM_turnOn();">ON</button>
</div>
</div>
</div>
</body>
Note: Since I don't have the styles defined with id like sidebar, so the sidebar appears in the left side.
ALso you can view here
I'm getting this error when I attempt to run my Next app:
Server Error
Error: Failed prop type: The prop href expects a string or object in <Link>, but got undefined instead.
I have all the tags pointing to id's within the SPA. I'm not seeing where it's getting the 'undefined' from. Could someone point this out and maybe provide some insight on how to find the initial point it messed up?
This is the Layout.js:
import Link from "next/link";
export default function Layout({children}){
return (<>
<div className="container mx-auto w-screen md:container md:mx-auto top-0 b" id="topNavBar">
<div className=" flex justify-between" id="topNavarInner">
<a className="button p-4 b" href="#">LOGO</a>
<div className="flex " id="topNavBarMenuGroup">
<Link href="#web-development" id="topNavBarMenu-webDevSection" className="">
<a className="button p-2 h-full flex items-center b">Web Development</a>
</Link>
<Link href="#email-development" id="topNavBarMenu-emailDevSection" className="">
<a className="button p-2 h-full flex items-center b">Email Development</a>
</Link>
</div>
</div>
</div>
{children}
<div id="footer">
<div className="container mx-auto w-screen md:container md:mx-auto sticky bottom-0 b">
<div className=" flex justify-center " id="footerInner">
<p className="p-4 b">FOOTER</p>
</div>
</div>
</div>
</>)
}
This is the pages/index.js:
import {useState,useEffect} from "react";
import Head from "next/head";
import Link from "next/link";
import Image from 'next/image';
import {microblog_entries} from "../data/microblog-entries";
import projectPieces from "../data/projectInfo";
import emailDevProjectPieces from "../data/emailDevProjectInfo";
import graphicArtPieces from "../data/graphicArtInfo";
import {personalText,professionalText,picture,techUsed} from "../data/aboutMeInfo";
export default function Home() {
const microblogPhrase = "Tiny gods with tiny computers."
const [projects,setProjects] = useState(projectPieces);
const [emailDevProjects,setemailDevProjects] = useState(emailDevProjectPieces);
const [graphicArt,setGraphicArt] = useState(graphicArtPieces);
return (<>
<Head>
<title>JZ-Portfolio</title>
</Head>
<section className="container px-6 mx-auto h-screen flex flex-col justify-center items-center" id="landingPage">
<table className="table table-auto border">
<tbody>
<tr id="title-row">
<td className="pb-5 text-center">
<div className="text-4xl font-bold">Jason Zamora's <span className="text-4xl">portfolio</span></div>
</td>
</tr>
<tr id="subTitle-row">
<td className="pb-5 text-center text-white">
<p className="text-white">web | email developer </p>
</td>
</tr>
<tr id="microBlog-row">
<td className="py-2 text-center border border-3">
<p>{microblogPhrase}</p>
</td>
</tr>
</tbody>
</table>
</section>
<WebDevSection projects={projects}/>
<EmailDevSection emailDevProjects={emailDevProjects}/>
<GraphicArtSection graphicArt={graphicArt}/>
<AboutMeSection/>
</>)
}
const WebDevSection = ({projects})=>{
return(<>
<section className="container mx-auto h-fit flex flex-col " id="web-development">
<table className=" table table-auto b">
<tbody>
<tr id="webDev-title-row" className="">
<td className="pt-4 text-2xl text-white/75 " >
<span className="pl-6">web development</span><br/>
<span className="pl-10 relative top-[-1rem] text-6xl ">Projects</span>
<ul id="webDevNavMenu" className="p-2 -top-11 flex flex-col relative float-right sm:top-1 sm:justify-around sm:justify-self-center sm:flex-row sm:float-none">
<Link href="#email-development">
<a><li className="text-base p-2 text-right button">Email Development</li></a>
</Link>
<Link href="#graphic-art">
<a><li className="text-base p-2 text-right button">Graphic Art</li></a>
</Link>
<Link href="#about-me">
<a><li className="text-base p-2 text-right button">About me</li></a>
</Link>
</ul>
</td>
</tr>
<tr id="webDev-links-row" className="border-t-2 col-span-2 flex flex-wrap justify-evenly">
{projects.map((project,index)=>{
return (
<td className="shrink-0 p-2 button" key={project.id}>
<Link href={`#${project.id}`} key={`${project.name}-link`}>
<a className=" h-full" id={`${project.id}-link`} key={`${project.name}-anchor`}>
{project.name}
</a>
</Link>
</td>
)
})}
</tr>
<tr id="webDev-items-row" className="flex flex-col pt-4 lg:flex-row lg:gap-2 lg:flex-wrap lg:space-around ">
{projects.map((project,index)=>{
return (
<td id={`${project.id}`} className="w-11/12 mx-auto my-1 lg:w-5/12 lg:shrink-0 b" key={project.id}>
<div id={`${project.id}-grid`} className="grid grid-cols-[50%_50%] grid-rows-[70%_18%_12%] h-[250px] lg:h-[450px] lg:grid-rows-[50%_150px_auto] ">
<div id={`${project.id}-screenshot`} className="col-span-1 row-span-2 m-auto lg:col-span-2 lg:row-span-1 ">
<Image src={project.screenShot} width={375} height={235} />
</div>
<div id={`${project.id}-info`} className="p-4 pt-1 lg:col-span-2 ">
<h1 id={`${project.id}-title`} className="text-center py-1 font-bold lg:pt-5">{project.name}</h1>
<p id={`${project.id}-description`} className="text-sm leading-4 lg:text-[1rem] lg:leading-5 lg:p-4 lg:border-b-4 border-white" >{project.description}</p>
</div>
<div id={`${project.id}-techStack`} className="text-xs flex items-center justify-center p-2 text-center lg:text-sm ">
{project.techStack}
</div>
<div id={`${project.id}-external-links-group`} className="col-span-2 row-start-3 flex items-center justify-evenly lg:col-span-1 ">
<Link href={project.url} className="">
<a id={`${project.id}-url`} className="font-bold button px-4" target="_blank">live site</a>
</Link>
<div className="spacer"> </div>
<Link href={project.git}>
<a id={`${project.id}-github`} className="font-bold" target="_blank">github</a>
</Link>
</div>
</div>
</td>
)
})}
</tr>
</tbody>
</table>
</section>
</>)
}
const EmailDevSection = ({emailDevProjects})=>{
return (<>
<section className="container mx-auto h-fit flex flex-col " id="email-development">
<table className="table table-auto">
<tbody>
<tr id="emailDev-title-row" className="">
<td className=" pt-6 text-2xl text-white/75">
<span className="pl-6">Email Development</span><br/>
<span className="pl-10 relative top-[-1rem] text-6xl ">Projects</span>
<ul id="emailDevNavMenu" className="p-2 -top-11 flex flex-col relative float-right sm:top-1 sm:justify-around sm:justify-self-center sm:flex-row sm:float-none">
<Link href="#web-development">
<a><li className="text-base p-2 text-right button">Web Development</li></a>
</Link>
<Link href="#graphic-art">
<a><li className="text-base p-2 text-right button">Graphic Art</li></a>
</Link>
<Link href="#about-me">
<a><li className="text-base p-2 text-right button">About me</li></a>
</Link>
</ul>
</td>
</tr>
<tr id="emailDev-links-row" className="border-t-2 flex flex-wrap justify-evenly">
{emailDevProjects.map((emailDevProject)=>{
return (
<td className="shrink-0 p-2 button" key={`${emailDevProject.id}-container`}>
<Link href={`#${emailDevProject.id}`} key={`${emailDevProject.name}-link`}>
<a className=" h-full" id={`${emailDevProject.id}-link`} key={`${emailDevProject.name}-anchor`}>
{emailDevProject.name}
</a>
</Link>
</td>
)
})}
</tr>
<tr id="emailDev-items-row" className=" flex flex-col pt-4 b">
{emailDevProjects.map((emailDevProject)=>{
return (
<td id={`${emailDevProject.id}`} className="w-11/12 mx-auto my-1 b" key={`${emailDevProject.id}-container`}>
<div id={`${emailDevProject.id}-grid`} className="grid grid-cols-[30%_auto] grid-rows-[70%_18%_auto] h-[250px] b">
<div id={`${emailDevProject.id}-screenshot`} className="col-span-1 row-span-2 m-auto b">insert image</div>
<div id={`${emailDevProject.id}-info`} className="p-4 pt-1 b">
<h1 id={`${emailDevProject.id}-title`} className="text-center py-1 font-bold ">{emailDevProject.name}</h1>
<p id={`${emailDevProject.id}-description`} className="text-sm leading-4">{emailDevProject.description}</p>
</div>
<div id={`${emailDevProject.id}-techStack`} className="text-xs flex items-center justify-center p-2 text-center b">
{emailDevProject.techStack}
</div>
<div id={`${emailDevProject.id}-external-links-group`} className="col-span-2 row-start-3 flex items-center justify-evenly b">
<Link href={emailDevProject.url} className="">
<a id={`${emailDevProject.id}-url`} className="font-bold button px-4" target="_blank">live site</a>
</Link>
<div className="spacer"> </div>
<Link href={emailDevProject.git}>
<a id={`${emailDevProject.id}-github`} className="font-bold" target="_blank">github</a>
</Link>
</div>
</div>
</td>
)
})}
</tr>
</tbody>
</table>
</section>
</>)
}
const GraphicArtSection = ({graphicArt})=>{
return (<>
<section className="container mx-auto h-fit flex flex-col " id="graphic-art">
<table className=" table table-auto b">
<tbody>
<tr id="graphicArt-title-row" className="">
<td className="pt-4 text-2xl text-white/75 " >
<span className="pl-6">Graphic</span><br/>
<span className="pl-10 relative top-[-1rem] text-6xl ">Art</span>
<ul id="graphicArtNavMenu" className="p-2 -top-11 flex flex-col relative float-right sm:top-1 sm:justify-around sm:justify-self-center sm:flex-row sm:float-none">
<Link href="#web-development">
<a><li className="text-base p-2 text-right button">Web Development</li></a>
</Link>
<Link href="#email-development">
<a><li className="text-base p-2 text-right button">Email Development</li></a>
</Link>
<Link href="#about-me">
<a><li className="text-base p-2 text-right button">About me</li></a>
</Link>
</ul>
</td>
</tr>
<tr id="graphicArt-links-row" className="border-t-2 col-span-2 flex flex-wrap justify-evenly">
{graphicArt.map((artPiece,index)=>{
return (
<td className="shrink-0 p-2 button" key={artPiece.id}>
<Link href={`#${artPiece.id}`} key={`${artPiece.name}-link`}>
<a className=" h-full" id={`${artPiece.id}-link`} key={`${artPiece.name}-anchor`}>
{artPiece.name}
</a>
</Link>
</td>
)
})}
</tr>
<tr id="graphicArt-items-row" className="flex flex-col pt-4 b">
{graphicArt.map((artPiece,index)=>{
return (
<td id={`${artPiece.id}`} className="w-11/12 mx-auto my-1 b" key={artPiece.id}>
<div id={`${artPiece.id}-grid`} className="grid grid-rows-[90%_auto] h-96 b">
<div id={`${artPiece.image}`} className="p-1 bg-black bg-contain "></div>
<div id={`${artPiece.description}`} className="flex items-center justify-center">{artPiece.description}</div>
</div>
</td>
)
})}
</tr>
</tbody>
</table>
</section>
</>)
}
const AboutMeSection = ({aboutInfo})=>{
return (<>
<section className="container mx-auto h-screen flex flex-col " id="about-me">
<table className=" table table-auto ">
<tbody>
<tr id="aboutMe-title-row" className="">
<td className=" pt-6 text-2xl text-white/75">
<span className="pl-6">About</span><br/>
<span className="pl-10 relative top-[-1rem] text-6xl ">Me</span>
<ul id="aboutMeNavMenu" className="p-2 -top-11 flex flex-col relative float-right border-b-2 sm:top-1 sm:justify-around sm:justify-self-center sm:flex-row sm:float-none">
<Link href="#web-development">
<a><li className="text-base p-2 text-right button">Web Development</li></a>
</Link>
<Link href="#email-development">
<a><li className="text-base p-2 text-right button">Email Development</li></a>
</Link>
<Link href="#graphic-art">
<a><li className="text-base p-2 text-right button">Graphic Art</li></a>
</Link>
</ul>
</td>
</tr>
<tr className="">
<div id="aboutme-grid" className=" mt-6 p-6 grid grid-cols-6 gap-4 ">
<div id="personal-info" className="col-span-4 text-right break-words">{personalText}</div>
<div id="personal-heading" className="col-span-2 col-start-5 flex justify-center items-center bg-gradient-to-r from-[#334] to-transparent ">
<h1 className="text-2xl ">Personal</h1>
</div>
<div id="professional-heading" className="col-span-2 col-start-1 flex justify-center items-center bg-gradient-to-l from-[#334] to-transparent">
<h1 className="text-2xl">Professional</h1>
</div>
<div id="professional-info" className="col-start-3 col-span-4 ">{professionalText}</div>
</div>
</tr>
<tr id="techUsed-title" className="flex justify-center text-2xl bg-[#334] py-4">Technologies used:</tr>
<tr id="techUsed-row" className="flex flex-wrap items-center justify-evenly bg-white ">
{techUsed.map((icon)=>{
return (
<div id={`${icon.name}-icon`} className="p-1" key={`${icon.name}`}>
<Image src={`/${icon.logo}`} width="40" height="40" />
</div>
)
})}
</tr>
</tbody>
</table>
</section>
</>)}
I am using Tailwindcss for my Rails app, My colleague created navbar with a dropdown menu.
I have now tried to add a Tailwindcss template hero section that was including a navbar (which i commented out in my code below). Now the dropdown menu is hidden behind the hero section. I have tried changing the position from absolute to position relative and giving it a higher z-index value than the hero section without success.
How can I make the dropdowns appear on top of page content? Any help would be greatly appreciated, thank you.
_navbar.html.erb
<nav class="z-20 bg-white border-b border-gray-100 shadow-md">
<div class="max-w-7xl mx-auto p-4 sm:px-6 lg:px-8">
<div class="hidden md:flex-1 md:flex md:items-center md:justify-between relative">
<nav class="flex space-x-10">
<%= link_to t("navigation_bar.home"), root_path, class:"text-base font-medium text-gray-500 hover:text-gray-900" %>
</nav>
<% if user_signed_in? %>
<div class="flex items-center relative">
<button class="p-1 rounded-full text-gray-600 hover:text-gray-100 hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white" aria-label="Notifications">
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" />
</svg>
</button>
<!-- Profile dropdown -->
<div class="relative inline-block text-left dropdown">
<span class="rounded-md shadow-sm">
<button class="inline-flex justify-center px-1 py-1 w-full text-sm font-medium leading-5 text-gray-800 transition duration-150 ease-in-outp-1 rounded-full text-gray-600 hover:text-gray-100 hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white"
type="button" aria-haspopup="true" aria-expanded="true" aria-controls="headlessui-menu-items-117">
<div class="relative w-8 h-8 overflow-hidden bg-gray-100 rounded-full dark:bg-gray-500">
<svg class="absolute w-10 h-10 text-gray-300 -left-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd"></path>
</svg>
</div>
</button>
</span>
<div class="opacity-0 invisible dropdown-menu transition-all duration-300 transform origin-top-right -translate-y-2 scale-95">
<div class="absolute right-0 w-56 mt-2 origin-top-right bg-gray-100 border border-gray-200 divide-y divide-gray-100 rounded-md shadow-lg outline-none" aria-labelledby="headlessui-menu-button-1" id="headlessui-menu-items-117" role="menu">
<div class="px-4 py-3">
<li class="text-sm list-none leading-5"><%= t("navigation_bar.signed_in_as" , user_full_name: current_user.full_name) %></li>
<li class="text-sm list-none font-medium leading-5 text-gray-900 truncate"><%= current_user.email %></li>
<div class="py-1">
<a href="javascript:void(0)" tabindex="0" class="text-gray-700 flex justify-between w-full px-4 py-2 text-sm leading-5 text-left hover:border-b-2 border-gray-400 hover:text-gray-900 text-gray-700 rounded-3xl" role="menuitem" ><%= t("navigation_bar.dashboard") %></a>
<a href="javascript:void(0)" tabindex="1" class="text-gray-700 flex justify-between w-full px-4 py-2 text-sm leading-5 text-left hover:border-b-2 border-gray-400 hover:text-gray-900 text-gray-700 rounded-3xl" role="menuitem" ><%= t("navigation_bar.settings") %></a>
<%= link_to t("navigation_bar.profile"), profile_path, class: 'text-gray-700 flex justify-between w-full px-4 py-2 text-sm leading-5 text-left hover:border-b-2 border-gray-400 hover:text-gray-900 text-gray-700 rounded-3xl" role="menuitem' %>
<span role="menuitem" tabindex="-1" class="flex justify-between w-full px-4 py-2 text-sm leading-5 text-left hover:hover:border-b-2 border-gray-400 rounded-3xl text-gray-700 cursor-not-allowed opacity-50" aria-disabled="true">New feature (soon)</span>
<div class="py-1">
<a href="javascript:void(0)" tabindex="3" role="menuitem" >
<%= link_to t("navigation_bar.sign_out"), destroy_user_session_path, method: :delete, class:"text-gray-700 flex justify-between w-full px-4 py-2 text-sm leading-5 text-left hover:hover:border-b-2 border-gray-400 rounded-3xl" %></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<% else %>
<div class="flex items-center md:ml-12">
<%= link_to t("sign_in"), new_user_session_path, class: "text-base font-medium text-gray-500 hover:text-gray-900" %>
<%= link_to t("sign_up"), register_path, class: "ml-8 inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700" %>
</div>
<% end %>
<!-- Mobile menu, show/hide based on menu state. -->
<div class="md:hidden p-2 space-y-1 sm:px-3" id="mobile-menu">
<div class="pb-2 justify-between">
<%# AVATAR ICON %>
<div class="flex items-center justify-between pl-5 pr-2">
<div>
<div class="flex itmes-center">
<div class="relative w-10 h-10 overflow-hidden bg-gray-100 rounded-full dark:bg-gray-600">
<svg class="absolute w-12 h-12 text-gray-400 -left-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z" clip-rule="evenodd"></path></svg>
</div>
<div class="flex items-center ml-4">
<% if current_user %>
<div class="text-base font-medium leading-none text-white"><%= current_user.first_name %></div>
<div class="text-sm font-medium leading-none text-gray-400"><%= current_user.email %></div>
<% end %>
</div>
</div>
</div>
<div class="relative" data-controller="dropdown">
<!-- Hamburger menu -->
<button data-action="click->dropdown#toggle" data-dropdown-target="button" type="button" class="rounded-3xl p-1 -mr-4 inline-flex items-center justify-center text-gray-800 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-gray-400" aria-expanded="false">
<svg class="h-8 w-8" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="false">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
<div data-dropdown-target="menu" class="absolute pin-r mt-2 transform shadow transition hover:border-gray-600 hidden right-0">
<div class="block w-80 justify-center bg-gray-800 py-1 px-8 leading-8 divide-y divide-gray-600 rounded-md border-gray-600 overflow-hidden">
<%= link_to t("navigation_bar.home"), root_path, class:"px-1 py-2 justify-center text-white text-decoration-none group flex items-center text-base font-medium hover:text-gray-600 hover:bg-gray-600" %>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</nav>
<style>
.dropdown:focus-within .dropdown-menu {
opacity:1;
transform: translate(0) scale(1);
visibility: visible;
z-index: 20;
}
</style>
home.html.erb
<!-- This example requires Tailwind CSS v2.0+ -->
<div class="relative bg-white overflow-hidden">
<div class="max-w-7xl mx-auto">
<div class="relative z-10 pb-8 bg-white sm:pb-16 md:pb-20 lg:max-w-2xl lg:w-full lg:pb-28 xl:pb-32">
<svg class="hidden lg:block absolute right-0 inset-y-0 h-full w-48 text-white transform translate-x-1/2" fill="currentColor" viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true">
<polygon points="50,0 100,0 50,100 0,100" />
</svg>
<div>
<div class="relative pt-6 px-4 sm:px-6 lg:px-8">
<!-- commented out -->
<%# <nav class="relative flex items-center justify-between sm:h-10 lg:justify-start" aria-label="Global">
<div class="flex items-center flex-grow flex-shrink-0 lg:flex-grow-0">
<div class="flex items-center justify-between w-full md:w-auto">
<a href="#">
<span class="sr-only">Workflow</span>
<img alt="Workflow" class="h-8 w-auto sm:h-10" src="https://tailwindui.com/img/logos/workflow-mark-indigo-600.svg">
</a>
<div class="-mr-2 flex items-center md:hidden">
<button type="button" class="bg-white rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<!-- Heroicon name: outline/menu -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
</div>
</div>
</div>
<div class="hidden md:block md:ml-10 md:pr-4 md:space-x-8">
Product
Features
Marketplace
Company
Log in
</div>
</nav> %>
</div>
<!--
Mobile menu, show/hide based on menu open state.
Entering: "duration-150 ease-out"
From: "opacity-0 scale-95"
To: "opacity-100 scale-100"
Leaving: "duration-100 ease-in"
From: "opacity-100 scale-100"
To: "opacity-0 scale-95"
-->
<%# <div class="absolute z-10 top-0 inset-x-0 p-2 transition transform origin-top-right md:hidden">
<div class="rounded-lg shadow-md bg-white ring-1 ring-black ring-opacity-5 overflow-hidden">
<div class="px-5 pt-4 flex items-center justify-between">
<div>
<img class="h-8 w-auto" src="https://tailwindui.com/img/logos/workflow-mark-indigo-600.svg" alt="">
</div>
<div class="-mr-2">
<button type="button" class="bg-white rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500">
<span class="sr-only">Close main menu</span>
<!-- Heroicon name: outline/x -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
<div class="px-2 pt-2 pb-3 space-y-1">
Product
Features
Marketplace
Company
</div>
Log in
</div>
</div> %>
<!-- commented back-->
</div>
<main class="mt-10 mx-auto max-w-7xl px-4 sm:mt-12 sm:px-6 md:mt-16 lg:mt-20 lg:px-8 xl:mt-28">
<div class="sm:text-center lg:text-left">
<h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl">
<span class="block xl:inline"><%= t("home_page.hero.header_1") %></span>
<span class="block text-indigo-600 xl:inline"><%= t("home_page.hero.header_2") %></span>
</h1>
<p class="mt-3 text-base text-gray-500 sm:mt-5 sm:text-lg sm:max-w-xl sm:mx-auto md:mt-5 md:text-xl lg:mx-0"><%= t("home_page.hero.description") %></p>
<div class="mt-5 sm:mt-8 sm:flex sm:justify-center lg:justify-start">
<div class="rounded-md shadow">
<%= t("home_page.hero.cta_1") %>
</div>
<div class="mt-3 sm:mt-0 sm:ml-3">
<%= t("home_page.hero.cta_2") %>
</div>
</div>
</div>
</main>
</div>
</div>
<div class="lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2">
<img class="h-56 w-full object-cover sm:h-72 md:h-96 lg:w-full lg:h-full" src="https://source.unsplash.com/Y5bvRlcCx8k" alt="">
</div>
</div>
{/* Profile dropdown */}
<Menu as="div" className="ml-3 relative z-[100]">
#... elements ....
</Menu>
class z-index will resolve the issue. in twinland CSS you can assign z-index as follows z-[100]
I've been trying for hours to center the image in this table, but I cannot make it work. The image is in the middle of this code. I hope this is a workable example.
<table class="container mx-auto mt-2">
<thead>
#foreach($posts as $post)
<tr>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Title</th>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Image</th>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Status</th>
<th class="p-3 font-bold uppercase bg-gray-200 text-gray-600 border border-gray-300 hidden lg:table-cell">Action</th>
</tr>
</thead>
<tbody>
<tr class="bg-white lg:hover:bg-gray-100 flex lg:table-row flex-row lg:flex-row flex-wrap lg:flex-no-wrap mb-10 lg:mb-0">
<td class="w-full lg:w-auto p-3 text-gray-800 text-center border border-b block lg:table-cell relative lg:static">
<span class="lg:hidden absolute top-0 left-0 bg-blue-200 px-2 py-1 text-xs font-bold uppercase">title</span>
{{ $post->title }}
</td>
<td class="w-full lg:w-auto p-3 text-gray-800 border border-b text-center block lg:table-cell relative lg:static">
<span class="lg:hidden absolute top-0 left-0 bg-blue-200 px-2 py-1 text-xs font-bold uppercase">Image</span>
<img class=" text-center block w-8 h-8 rounded-full " src="{{ asset('storage/photos/'. $post->image ) }}" />
</td>
<td class="w-full lg:w-auto p-3 text-gray-800 text-center border border-b text-center block lg:table-cell relative lg:static">
<span class="lg:hidden absolute top-0 left-0 bg-blue-200 px-2 py-1 text-xs font-bold uppercase">Status</span>
#if($post->active )
active
#else
Not active
#endif
</td>
<td class="w-full lg:w-auto p-3 text-gray-800 text-center border border-b text-center block lg:table-cell relative lg:static">
<span class="lg:hidden absolute top-0 left-0 bg-blue-200 px-2 py-1 text-xs font-bold uppercase">Actions</span>
<x-jet-button wire:click="showEditPostModal({{ $post->id }})" class="bg-green-500">Edit</x-jet-button>
<x-jet-button wire:click="deletePost({{ $post->id}})" class="bg-red-700">Delete</x-jet-button>
</td>
</tr>
#endforeach
</tbody>
</table>
Images in Tailwind are set to block-level by default so they can be centered with CSS properties like margin: 0 auto or with the mx-auto class. Basically element require to be block (has its width) to be centered this way.
In general this guide is very useful to know every possible way of centering elements
you can add the "flex-auto" class.
if you want any things show
I have a web page styled with tailwindcss that also uses glide.js to create a carousel element. I have a mobile menu triggered by a hamburger button but the resulting menu renders below the glide.js element. I have tried making elements relative and absolute in multiple combinations and also tried static on the carousel element. I have also tried z indexing the elemnts but I cant get my popup menu to render over the glide.js carousel.
Here is a fiddle which if viewed at 616 px width demonstrates my issue.
JS Fiddle Link
<div x-data="{ open: false, menu: false }" class="mt-4 relative bg-white overflow-hidden">
<div class="relative max-w-screen-xl mx-auto">
<div class="relative z-10 pb-8 bg-blue-100 sm:pb-16 md:pb-20 lg:max-w-2xl lg:w-full lg:pb-6 xl:pb-8">
<div class="pt-2 px-4 sm:px-6 lg:px-8">
<nav class="relative flex items-center sm:h-10 justify-start">
<div class="flex items-center flex-grow flex-shrink-0 lg:flex-grow-0">
<div class="flex items-center justify-between w-full lg:w-auto mt-4">
<div class="-mr-2 items-center lg:hidden">
<button #click="open = true" type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
</div>
<img class="lg:hidden" width="100" height="50" src="{{asset('images/epslogo.png')}}" alt="">
</div>
</div>
<div class="hidden lg:flex lg:items-center lg:block lg:mt-4">
<a href="/" class="font-medium text-gray-500 hover:text-gray-900 focus:outline-none focus:text-gray-900 transition duration-150 ease-in-out">
<input width="100" height="50" type="image" src="{{asset('images/EPSnav.png')}}" alt="EPS Logo">
</a>
High Voltage
Low Voltage
EV Charge Points
More...
<div x-show.transition.duration.600ms="menu" #click.away="menu = false" class="z-10 absolute ml-24 top-12 right-0 py-2 bg-white rounded shadow-2xl" >
<a class="block px-4 py-2 text-gray-700 hover:text-white hover:bg-gray-700"
href="#">
Maintenance and Inspection
</a>
<a class="block px-4 py-2 text-gray-700 hover:text-white hover:bg-gray-700"
href="/design">
Design Services
</a>
<a class="block px-4 py-2 text-gray-700 hover:text-white hover:bg-gray-700"
href="#">
Senior Authorised Personnel
</a>
<a class="block px-4 py-2 text-gray-700 hover:text-white hover:bg-gray-700"
href="/contact">
Contact Us
</a>
<a class="block px-4 py-2 text-gray-700 hover:text-white hover:bg-gray-700"
href="#">
About Us
</a>
</div>
</div>
</nav>
</div>
<div
x-show="open"
x-transition:enter="duration-150 ease-out"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="duration-100 ease-in"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
class="absolute top-0 inset-x-0 p-2 transition transform origin-top-right z-50"
>
<div class="relative rounded-lg bg-white shadow-xs overflow-hidden">
<div class="px-5 pt-4 flex items-center justify-between">
<div class="-mr-2">
<button #click="open = false" type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
<img class="ml-2" width="100" height="50" src="{{asset('images/epslogo.png')}}" alt="">
</div>
<div class="relative px-2 pt-2 pb-3">
Home
High Voltage
Low Voltage
EV Charge Points
Maintenance and Inspection
Design Services
Senior Authorised Personnel
Contact Us
</div>
</div>
</div>
<div class="relative mt-6 mx-auto max-w-screen-xl px-4 sm:mt-12 sm:px-6 md:mt-6 lg:mt-8 lg:px-8 xl:mt-10">
<div class="text-center lg:text-left">
<h1 class="text-5xl text-gray-700 font-bold">Electrical Power Solutions</h1>
{{-- <img class="h-32 mx-auto mb-4 lg:mx-0" src="{{asset('images/epslogo.png')}}" alt="EPS Logo">--}}
<h2 class="text-indigo-400 text-4xl">Over {{now()->year - 2005}} years of Experience.</h2>
<p class="mt-2 text-base text-gray-500 sm:mt-4 sm:text-lg sm:max-w-xl sm:mx-auto md:mt-2 md:text-xl lg:mx-0">
Supplying High and Low voltage services to the Energy Sector for over {{now()->year - 2005}} years.
</p>
<div class="mt-6">
<a href="/contact" class="text-center rounded-lg border border-transparent bg-indigo-600 px-1 py-1 text-xl leading-6 font-medium text-white hover:bg-indigo-500 focus:outline-none focus:border-indigo-700 focus:shadow-outline-indigo transition ease-in-out duration-150">
Contact Us
</a>
</div>
</div>
</div>
<svg class="hidden lg:block absolute right-0 inset-y-0 h-full w-48 text-blue-200 transform translate-x-1/2" fill="currentColor" viewBox="0 0 100 100" preserveAspectRatio="none">
<polygon points="50,0 100,0 50,100 0,100" />
</svg>
</div>
</div>
<div class="hidden lg:block lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2">
<img class="h-56 w-full object-cover sm:h-72 md:h-96 lg:w-full lg:h-full" src="{{asset('images/high-voltage.jpg')}}" alt="" />
</div>
</div>
{{--Carousel Heading with standard nav --}}
<div class="hidden lg:block lg:mt-1 lg:mb-1">
<div class="glide">
<div class="glide__track" data-glide-el="track">
<ul class="glide__slides">
<li class="glide__slide">
<div class="block w-full text-white text-5xl text-center">
<img class="object-cover" src='/images/hv.jpg' alt="High Voltage Pylons Picture">
</div>
</li>
<li class="glide__slide">
<div class="block w-full text-white text-5xl text-center">
<img class="object-cover" src='/images/design.jpg' alt="Rolled up design documents">
</div>
</li>
<li class="glide__slide">
<div class="block w-full text-white text-5xl text-center">
<img class="object-cover" src='/images/rope.jpg' alt="Rope access personnel at work">
</div>
</li>
<li class="glide__slide">
<div class="block w-full text-white text-5xl text-center">
<img class="object-cover" src='/images/WTS.jpg' alt="Wind turbines at sunset">
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="lg:hidden">
<div class="glide1">
<div class="glide__track" data-glide-el="track">
<ul class="glide__slides">
<li class="glide__slide">
<div class="block w-full text-white text-5xl text-center">
<img class="object-cover" src='/images/hv.jpg' alt="High Voltage Pylons Picture">
</div>
</li>
<li class="glide__slide">
<div class="block w-full text-white text-5xl text-center">
<img class="object-cover" src='/images/design.jpg' alt="Rolled up design documents">
</div>
</li>
<li class="glide__slide">
<div class="block w-full text-white text-5xl text-center">
<img class="object-cover" src='/images/rope.jpg' alt="Rope access personnel at work">
</div>
</li>
<li class="glide__slide">
<div class="block w-full text-white text-5xl text-center">
<img class="object-cover" src='/images/WTS.jpg' alt="Wind turbines at sunset">
</div>
</li>
</ul>
</div>
</div>
</div>
Any help is appreciated.
Problem is not with slider, z-index, absolute etc, but in fact that you intentionally putted "overflow-hidden" on menu container. Because of this menu that is bigger than its container is "cutted". To test this you can actually remove all content from below (including glide) and keep only menu (header) - problem will still remain.
So replace this:
<div x-data="{ open: false, menu: false }" class="mt-4 relative bg-white overflow-hidden">
with:
<div x-data="{ open: false, menu: false }" class="mt-4 relative bg-white">
Fiddle: https://jsfiddle.net/39d6qhg5/
More info about overflow:
https://www.w3schools.com/cssref/pr_pos_overflow.asp
https://tailwindcss.com/docs/overflow/