HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XAT Score Calculator</title>
<style>
/* General Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background-color: #f9f9f9;
padding: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
background: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.calculator-section {
margin-bottom: 50px;
padding-bottom: 30px;
border-bottom: 2px solid #ddd;
}
h1 {
font-size: 24px;
color: #333;
text-align: center;
margin-bottom: 20px;
}
form {
display: flex;
flex-direction: column;
gap: 15px;
}
.input-group {
display: flex;
flex-direction: column;
}
.input-group label {
margin-bottom: 5px;
font-weight: bold;
color: #444;
}
.input-group input {
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
padding: 10px 20px;
font-size: 16px;
color: #fff;
background: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
background: #0056b3;
}
.external-link-btn {
background: #28a745;
margin-top: 10px;
}
.external-link-btn:hover {
background: #1e7e34;
}
.result {
margin-top: 20px;
text-align: center;
}
.result h2 {
font-size: 20px;
margin-bottom: 10px;
}
.content-section {
margin-top: 50px;
}
.content-section h2 {
font-size: 20px;
color: #444;
margin-bottom: 15px;
}
.content-section p {
margin-bottom: 15px;
text-align: justify;
color: #555;
}
.content-section ul,
.content-section ol {
margin-left: 20px;
margin-bottom: 15px;
}
ul li,
ol li {
margin-bottom: 10px;
color: #555;
}
@media (max-width: 768px) {
h1 {
font-size: 20px;
}
button {
font-size: 14px;
padding: 8px 15px;
}
.content-section h2 {
font-size: 18px;
}
.content-section p {
font-size: 14px;
}
}
</style>
</head>
<body>
<div class="container">
<!-- Calculator Section -->
<div class="calculator-section">
<h1>XAT Score Calculator</h1>
<form id="scoreForm">
<div class="input-group">
<label for="correctAnswers">Number of Correct Answers:</label>
<input type="number" id="correctAnswers" min="0" required>
</div>
<div class="input-group">
<label for="incorrectAnswers">Number of Incorrect Answers:</label>
<input type="number" id="incorrectAnswers" min="0" required>
</div>
<div class="input-group">
<label for="unattemptedQuestions">Number of Unattempted Questions:</label>
<input type="number" id="unattemptedQuestions" min="0" required>
</div>
<button type="submit">Calculate Score</button>
</form>
<div id="result" class="result">
<h2>Your XAT Score:</h2>
<p id="score"></p>
</div>
<button class="external-link-btn" onclick="openExternalLink()">Visit Cracku XAT Score Calculator (Pro)</button>
</div>
<!-- Content Section -->
<div class="content-section">
<h2>How the Cracku XAT Score Calculator Helps You?</h2>
<p>The Cracku XAT Score Calculator is a simple and effective tool designed to help students calculate their scores in the XAT exam. The XAT (Xavier Aptitude Test) is one of the most important exams for students aspiring to join top management schools. With this calculator, you can get a clear idea of your potential score by entering basic details about your performance.</p>
<h2>What is the XAT Exam?</h2>
<p>The XAT exam is a national-level entrance test conducted every year for admission to MBA programs in top institutes. It is a competitive test with different sections like verbal ability, decision-making, quantitative aptitude, and general knowledge. Each correct answer gives you marks, while incorrect answers lead to negative marking. Questions that are not attempted beyond a certain limit may also result in penalties.</p>
<h2>Why Use the XAT Score Calculator?</h2>
<p>Calculating your XAT score manually can be a long and confusing process, especially when you consider negative marking and penalties for unattempted questions. This calculator simplifies everything for you. All you need to do is enter the number of correct answers, incorrect answers, and unattempted questions. The tool automatically calculates your score while considering all penalties and gives you an accurate result in seconds.</p>
<h2>Key Features of the XAT Score Calculator</h2>
<ul>
<li><b>User-Friendly:</b> You don’t need to be a tech expert to use this tool. The form is simple, and the results are instant.</li>
<li><b>Accurate Results:</b> The calculator uses official marking rules, including penalties for wrong and unattempted answers, to ensure accuracy.</li>
<li><b>Saves Time:</b> Manual calculations can take time and may lead to mistakes. This tool provides a quick and error-free solution.</li>
<li><b>Free to Use:</b> The calculator is completely free and available to all users.</li>
</ul>
<h2>How to Use the Calculator</h2>
<ol>
<li>Enter the number of questions you answered correctly in the first field.</li>
<li>Enter the number of incorrect answers in the second field.</li>
<li>Enter the number of unattempted questions in the third field.</li>
<li>Click on the “Calculate Score” button.</li>
<li>Your XAT score will be displayed below the calculator in a matter of seconds.</li>
</ol>
<h2>Tips to Score Better in the XAT Exam</h2>
<ul>
<li><b>Practice Regularly:</b> Solve mock tests and sample papers to get familiar with the exam pattern.</li>
<li><b>Understand the Negative Marking:</b> Focus on accuracy to avoid losing marks for incorrect answers.</li>
<li><b>Plan Your Time:</b> Divide your time wisely between sections and ensure that you attempt enough questions to minimize penalties.</li>
<li><b>Stay Updated:</b> Prepare for the general knowledge section by staying updated with current events.</li>
</ul>
<h2>Final Thoughts</h2>
<p>The Cracku XAT Score Calculator is a must-have tool for anyone preparing for the XAT exam. It not only helps you track your performance but also motivates you to aim higher. Use this tool after every mock test to understand your strengths and weaknesses. The more you practice, the closer you will be to achieving your dream score.</p>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
/* General Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background-color: #f4f4f4;
color: #333;
padding: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.calculator-section {
margin-bottom: 50px;
padding-bottom: 30px;
border-bottom: 2px solid #ddd;
}
h1 {
font-size: 24px;
color: #444;
text-align: center;
margin-bottom: 20px;
}
form {
display: flex;
flex-direction: column;
gap: 15px;
}
.input-group {
display: flex;
flex-direction: column;
}
.input-group label {
margin-bottom: 5px;
font-weight: bold;
}
.input-group input {
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
padding: 10px 20px;
font-size: 16px;
color: #fff;
background: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
background: #0056b3;
}
.external-link-btn {
background: #28a745;
margin-top: 10px;
}
.external-link-btn:hover {
background: #1e7e34;
}
.result {
margin-top: 20px;
text-align: center;
}
.result h2 {
font-size: 20px;
margin-bottom: 10px;
}
.content-section {
margin-top: 50px;
}
.content-section h2 {
font-size: 20px;
color: #333;
margin-bottom: 15px;
}
.content-section p {
margin-bottom: 15px;
text-align: justify;
}
@media (max-width: 768px) {
h1 {
font-size: 20px;
}
.content-section h2 {
font-size: 18px;
}
.content-section p {
font-size: 14px;
}
}
// Handle form submission for score calculation
document.getElementById('scoreForm').addEventListener('submit', function(event) {
event.preventDefault();
const correctAnswers = parseInt(document.getElementById('correctAnswers').value) || 0;
const incorrectAnswers = parseInt(document.getElementById('incorrectAnswers').value) || 0;
const unattemptedQuestions = parseInt(document.getElementById('unattemptedQuestions').value) || 0;
const negativeMarking = 0.25;
const unattemptedPenaltyThreshold = 8;
const unattemptedPenalty = 0.10;
let score = correctAnswers - (incorrectAnswers * negativeMarking);
if (unattemptedQuestions > unattemptedPenaltyThreshold) {
score -= (unattemptedQuestions - unattemptedPenaltyThreshold) * unattemptedPenalty;
}
document.getElementById('score').textContent = score.toFixed(2);
document.querySelector('.result').style.display = 'block';
});
// Open external link in a new tab
function openExternalLink() {
window.open('https://cgpatopercentage.in.net', '_blank');
}
Also see: Tab Triggers