Developing an interactive web interface with HTML

I've been attempting to design a flexible HTML page that replicates the layout of a Java applet clock, but I'm unsure if my current approach is correct.

Below is an example of the three-clock image set that I am currently working on. My method involves using div, margins, and padding in CSS to structure the clocks. However, due to varying font sizes within each line, I've resorted to using vmin font size to achieve auto-resizing, albeit with mixed results. I've scoured the internet for tutorials or examples that address this specific issue, only to come up empty-handed. The existing examples either resize paragraphs with uniform font sizes throughout, or incorporate images instead.

If anyone knows of a tutorial or example that tackles this problem, please share. Perhaps I should consider utilizing canvas or some alternative to div tags for this task.

https://i.stack.imgur.com/D7hyT.png

This snippet below represents my single clock page before adding the CSS elements:

<html>
  <head>
    <meta charset="utf-8"/>
    <meta name="description" content="AOS/LOS Clock" />
    <title>AOS/LOS Clock</title>
    <link rel="stylesheet" type="text/css" href="css/mc_style.css" />
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type=\"text/javascript\" src=\"js/mc_clocks.js?color=00ff00&file=input/aos_times_json;\"></script>
    <script type="text/javascript" src="js/mc_engine.js"></script>
  </head>

  <body id="body">
    <div id="wrapper">
      <div id="clockAOS" class="clock missionColor"></div>
      <div class="title missionColor"><span>Acquisition of Signal</span></div>
      <div id="relay" class="siteTdrs"></div>
      <div id="clockLOS" class="clock missionColor"></div>
      <div class="title missionColor"><span>Loss of Signal</span></div>
    </div>
    <p id="Msgs"></p>
  </body>
</html>

Answer №1

If you're looking to lay out elements on a webpage, I highly recommend checking out bootstrap. This framework makes creating responsive layouts easy and efficient.

When it comes to font sizing, achieving consistent results across all browsers and devices can be challenging. Even using pixels as a measurement unit may vary on different screen types. For more insights on font sizing, check out this article.

Answer №2

After revisiting the vs font descriptions and making adjustments to my css sheet, I was able to resize the fonts successfully. However, I noticed that the negative margin-left doesn't appear consistent between the linux box and PC even though I am using the same terminal screen. Despite this inconsistency, the overall result is an improvement from before.

<!DOCTYPE html>
<html>
<style>

body {
    font-family: helvetica, arial, sans-serif;
    font-weight: bold;
    color: #fff;
    background: #000;
    margin: 2vw 10vw 2vw 10vw;
}

span {
    white-space: nowrap;    /* Specify that the text in element will never wrap */
}

.header {
    font-size: 4vw;
    font-weight: bold;  /* bold font */
    color: lightGray;   // color for tdrs/site
}
.header-split      { 
    display:block;
    margin-left:15vw;
}
.header-split span {
    display:block;
    float:right;
    width:30%;
}
#header-ul {
    border-bottom: 3px solid lightgrey
}

#rm {
    text-align: center;
    margin-left:-10vw;
}
.siteTdrs {
    font-size: 3vw;
    font-weight: bold;  /* bold font */
    color: lightGray;   // color for tdrs/site
}
.mission {
    font-size: 4vw;
}

.clock {
    font-size: 8vw;
    text-align: center;
}

.terraColor {
    color: #00ff00; // GREEN
}
.aquaColor {
    color: #00ffff; // CYAN
}
.auraColor {
    color: #ffc800; // ORANGE
}

</style>

<body>
    <div id="wrapper">
      <div id="header-ul"><div class="header header-split">AOS<span>LOS</span></div></div>

      <div id="rm" ><span id="terraRelay" class="siteTdrs">TDE</span>&nbsp;&nbsp;<span class="mission terraColor">TERRA</span></div>
      <div id="terraTime" class="clock terraColor"><span>00:00:00&nbsp;&nbsp;00:00:00</span></div>

      <div id="rm" ><span id="aquaaRelay" class="siteTdrs">SG1</span>&nbsp;&nbsp;<span class="mission aquaColor">AQUA</span></div>
      <div id="aquaTime" class="clock aquaColor"><span>00:00:00&nbsp;&nbsp;00:00:00</span></div>

      <div id="rm" ><span id="auraRelay" class="siteTdrs">TDW</span>&nbsp;&nbsp;<span class="mission auraColor">AURA</span></div>
      <div id="auraTime" class="clock auraColor"><span>00:00:00&nbsp;&nbsp;00:00:00</span></div>
    </div>
    <p id="Msgs">this is a error</p>
</body>

</html>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Adding options to an HTML select dropdown menu using data stored in an array

Having reviewed several questions related to this issue, I am still encountering difficulties. Below is the code snippet that I am struggling with: <body> <?php //To begin, there is a form with a drop-down menu and a button, which will trigge ...

Controlling screen size in fullscreen mode for HTML5 videos: a guide to manipulation

Within my website, I have incorporated a <video> element nestled inside a <div>. This particular <div> serves the purpose of defining the video aspect ratio, allowing users to adjust it if necessary (for instances where the encoded video ...

Displaying a Color Sample in a Grid

I'm currently working on a feature that allows users to select colors using the jQuery minicolor widget. I really like how the color swatch appears inside the widget, but I'm having trouble replicating that same look in a data table. When I try t ...

Keep JS Accordion open when links are clicked

Utilizing PHP, I am fetching items from a database and creating an HTML table to display each item. Adjacent to the HTML table, there is a side menu with an accordion function implemented in JavaScript. Within each accordion section, there are links for ...

Angular's jQuery timepicker allows users to easily select a

Transitioning from jQuery to Angular, we previously utilized the for selecting times due to Firefox not supporting HTML5 input time. While searching for a similar timepicker plugin for Angular to maintain consistency with our past data and styles, I came ...

The code for styling the borders of links is not functioning as expected

I'm currently in the process of creating a buttoned-link feature. The aim is to incorporate a border around the link with an outset style, while having the border-style change to inset when the link is active using a:active and border-style: inset. A ...

Creating text input without borders using HTML and CSS

I have managed to create text inputs without borders using HTML and CSS, but I am facing an issue. Whenever I click on the input field, a yellow border appears instead of the one I removed. It seems like this is coming from the default stylesheets, and I&a ...

Minify and group options available for asset managers specifically designed for traditional HTML websites

My primary focus is on working with the CakePHP framework and utilizing a fantastic plugin that minifies and groups selected assets into a single file, reducing the number of HTTP requests needed for the entire site. Currently, I am collaborating with des ...

Tips for customizing the appearance of ToggleButton in material-ui

Currently, I'm working on customizing the ToggleButton in order to change the default color when it is selected. However, my attempts have been fruitless so far. const customizeStyles = makeStyles((theme) => ({ toggleButtonSelected: { &q ...

The chosen color for the link button in CSS

PHP CODE : $getOID=$_GET["id"]; for($i=$getOID-($getOID-1); $i<=5;$i++){ echo '<a class="current" href="postlogin.php?id='.$i.'">'.$i.'</a>'; } CSS STYLING FOR BUTTONS : .pagging { height:20px; ...

Tips for transferring a jQuery array to PHP

I am encountering an issue when trying to send a jQuery array to PHP. Initially, I have one form in HTML and upon clicking 'add', I end up with two forms. Afterwards, I input data into the form which is then stored in a jQuery array. However, I a ...

Creating a tiled grid layout using Bootstrap 3

I’m grappling with a masonry layout issue while using Bootstrap. In my code, I have 5 divs but I’m struggling to get Div 4 and 5 to move up as shown in the attached image. While using margin-top is a quick fix, it disrupts the responsive design. Any su ...

Change the x and y positions of several div elements as the mouse moves in JavaScript

I am aiming to create a webpage where multiple divs with text and other content move along the x and y axes of the mouse. The desired effect is similar to parallax scrolling, but I have found that existing parallax plugins are image-based and do not work w ...

What is the best way to arrange list items in this manner?

I am facing challenges with aligning elements properly on the navigation bar. I would like the words (home, players, about, contact) to be vertically centered in relation to the heart logo. Here is how it currently appears: This is how I want it to look ...

Stylish CSS typography options for both Mac and Windows users

When browsing various websites, I've noticed that many of them showcase beautiful fonts without using images. Examples include The Firebug site and Happy Cog. It seems like web designers use CSS tricks and JavaScript to achieve this effect. I'm ...

Is it possible to launch an Electron application by clicking a run button in the VSCode

I'm new to using VSCode and am currently working on an HTML5 app with Electron. I'm finding it cumbersome to switch between windows and enter a command each time I want to test my application. Is there a way to configure VSCode to run my Electron ...

Using a table row as a counter in HTML

I am looking for a way to automatically assign IDs to table rows using XSLT in a systematic manner. The idea is to have the ID consist of a string followed by a counter, like this: <table> <tr id="Row1"> # it can be only a number => id=" ...

Individual ".htaccess" and ".htpasswd" files are created for every webpage

I have a main page with links to 3 other pages (all within the same folder) named: content1.html, content2.html, and content3.html. <html> <body> <ul> <li><a href="content1.htm">content1</a></li> <li> ...

Using PHPMailer in conjunction with a textarea form and HTML

Currently, I am attempting to piece together code from a PHP tutorial that demonstrates how to create a basic PHPMailer form for sending plain text emails to a mailing list. The simplicity of the form is ideal as it will be used by only a few individuals. ...

Unable to retrieve data-id from <td> on click event

Can someone help with an issue I'm having in my code? Here is the snippet where I create a table data element: html += "<td data-id='test' class='journal' style='max-width:200px;'>"+record.source_account_code+"& ...