Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <style> .job-app-container { max-width: 650px; margin: 30px auto; padding: 30px; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 8px; font-family: sans-serif; box-shadow: 0 2px 5px rgba(0,0,0,0.05); } .job-app-container h2 { text-align: center; margin-bottom: 25px; } .job-app-container fieldset { border: 1px solid #ccc; border-radius: 6px; padding: 20px; margin-bottom: 20px; } .job-app-container legend { padding: 0 10px; font-weight: 600; color: #333; } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; font-weight: 500; } .form-group input[type="text"], .form-group input[type="email"], .form-group input[type="tel"], .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; box-sizing: border-box; } .form-group textarea { height: 150px; resize: vertical; } /* -- File Upload Styling -- */ .file-upload-group { display: flex; align-items: center; gap: 10px; } /* This hides the default file input button */ .file-upload-group input[type="file"] { display: none; } /* Style the label to look like a button */ .file-upload-group .file-upload-label { padding: 10px 15px; background-color: #555; color: white; border-radius: 4px; cursor: pointer; transition: background-color 0.2s; } .file-upload-group .file-upload-label:hover { background-color: #333; } /* For displaying the chosen file name */ .file-name { font-style: italic; color: #666; font-size: 0.9rem; } /* -- End File Upload Styling -- */ .submit-btn { display: block; width: 100%; padding: 12px; border: none; border-radius: 4px; background-color: #007bff; color: white; font-size: 1.1rem; font-weight: bold; cursor: pointer; } </style> <div class="job-app-container"> <h2>Job Application: Front-End Developer</h2> <form action="#" method="post" enctype="multipart/form-data"> <fieldset> <legend>Personal Information</legend> <div class="form-group"> <label for="full-name">Full Name</label> <input type="text" id="full-name" name="full_name" required> </div> <div class="form-group"> <label for="email">Email Address</label> <input type="email" id="email" name="email" required> </div> <div class="form-group"> <label for="phone">Phone</label> <input type="tel" id="phone" name="phone" required> </div> </fieldset> <fieldset> <legend>Application</legend> <div class="form-group"> <label for="cover-letter">Cover Letter</label> <textarea id="cover-letter" name="cover_letter" placeholder="Why are you a great fit for this role?"></textarea> </div> <div class="form-group"> <label for="resume-upload">Upload Resume/CV</label> <div class="file-upload-group"> <!-- The actual file input, visually hidden --> <input type="file" id="resume-upload" name="resume" accept=".pdf,.doc,.docx" required> <!-- The styled label that acts as a button --> <label for="resume-upload" class="file-upload-label">Choose File</label> <!-- A span to display the selected file's name --> <span class="file-name" id="file-name-display">No file chosen</span> </div> </div> </fieldset> <button type="submit" class="submit-btn">Submit Application</button> </form> </div> <script> const fileInput = document.getElementById('resume-upload'); const fileNameDisplay = document.getElementById('file-name-display'); if(fileInput) { fileInput.addEventListener('change', () => { if (fileInput.files.length > 0) { // Display the name of the first file selected fileNameDisplay.textContent = fileInput.files[0].name; } else { fileNameDisplay.textContent = 'No file chosen'; } }); } </script>