Using double quotation marks in CSS styling

I am currently working on converting a design into HTML and CSS.

https://i.sstatic.net/INP31.png

So far, I have been able to recreate the design in JSFiddle, but I'm struggling to add double inverted commas as shown in the original design.

In the HTML code snippet below, you can see how I've tried to create the second paragraph:

<div id="line2" class="col-lg-12">
                    <div class="cofounder-ceo-image">
                        <img src="assets/img/Uploads/jack_v1.jpg"> </div>
                    <p>Whatever you say Whatever you say [...] say</p>

                    <p class="ceo">Jack Lau - Co-founder and CEO</p>
                </div>

I'm interested to know if there is a CSS solution to replicate double inverted commas or if it's best to insert an image of them at a specific location?

Answer №1

To create a visual effect where one element is attached to another, you can utilize pseudo-elements such as ::after and ::before in your CSS code:

.our-vision p{
  position: relative;
}

.our-vision #line2 > p::before,
.our-vision #line3 > p::after{
  position: absolute;
  font-size: 5em;
  color: #ccc;
}

.our-vision #line2 > p::before{  
  content:"\201D";
  top: -0.5em;
  right: -0.5em;
}

.our-vision #line3 > p::after{
  content:"\201C";
  bottom: -0.5em;
  left: -0.5em;
}

Check out the live demo on Fiddle: https://jsfiddle.net/ttfwchq3/3/

However, it appears that the design concept resembles a reverse direction blockquote. Consider styling a blockquote element instead for a more semantically appropriate approach.

Answer №2

To add inverted quotes after every paragraph, you can utilize the ::after pseudo element. You can position them on either side as needed with the help of CSS. The following code snippet demonstrates how to achieve this effect for the first paragraph (specifically at the right), but you can create a reusable class by adjusting the properties for each side:

#line2 p {
  position: relative;
}
#line2 p:after {
  content: "\"";
  position: absolute;
  top: -50px;
  right: -100px;
  font-size: 140px;
  color: gray;
}

If you require an exact "inverted comma", consider using the same font as your example or opt for an image instead:

#line2 p:after {
  content: url(https://i.sstatic.net/wyH2G.png);
  position: absolute;
  top: -70px;
  right: -100px;
  font-size: 140px;
  color: gray;
}

For further reference and testing, check out this Fiddle.

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

Retrieving an image from a JSON file based on its corresponding URL

I am trying to extract the URL and display it as an image: This is how it appears in JSON: https://i.sstatic.net/vpxPK.png This is my HTML code: <ul> <li *ngFor="let product of store.Products"> <p>Product Image: {{ product.Pr ...

Using jQuery, you can activate an onclick function based on specific keywords entered by the user

Within this element, there is a text input field that allows users to search for specific items. Next to the input field is an icon image that can be clicked on to trigger a jQuery onclick event. This event sends an AJAX request to a PHP file, retrieves da ...

Tips for transforming HTML to a dynatable or datatable

I have a PHP page that returns HTML table data. I’m looking to convert this table into either DataTable or Dynatable. I’ve attempted to include the necessary files (JavaScript and CSS) in the page where the PHP script generates the table. In my JavaScr ...

Using JavaScript regular expressions to restrict the characters allowed in an HTML text input field

I am new to Regex and just starting out with Javascript. I am attempting to require users to follow a specific pattern when typing in the textarea. The pattern should start with 'X' followed by 9 numbers. If the first character is not an 'X ...

What is the best way to increase the height of an image in a grid container beyond the height of

I am currently designing a grid layout to showcase recent articles. Each article includes an image and a brief description. My goal is to have the image taller than the content text block, while ensuring responsiveness across various screen sizes. Below i ...

Exploring Molecular Structures with ThreeJS - Understanding the Mechanics of Double Bonds

Currently working with threejs and experimenting with the example found in this link: The challenge I'm facing is related to creating double bonds between grey and red spheres in the example. While I came across some resources suggesting ways to achi ...

I am trying to confirm in PHP whether any of the gender checkboxes have been selected. However, the code I have tried so far does not appear to be functioning as expected

Please refrain from suggesting the use of checked = "checked" in HTML, as the validation must be performed in PHP as per the requirements of my assignment. PHP Code: if (isset($_POST["gender"])) { $gender = $_POST["gender"]; if (($gender != "male") || ( ...

Guide to dynamically loading separate components on a single page in Angular 9

Rendering all components or widgets on the page at once can slow down the application's loading time. I prefer to have app-sidebar1, app-body, and app-sidebar2 load onto the DOM sequentially based on priority, rather than waiting for all components t ...

Header that stays in place even when there is too much content to fit horizontally

On my HTML page, I have a main header and body. Inside the body, there is another header and body that overflows horizontally. I want to ensure that no white space appears on the right side of both headers when the inner body scrollbar is moved right. Ins ...

Issues with the HTML5 progress bar malfunctioning due to alterations made by Angular

Using the html5 progress bar <progress value="5" max="100"></progress> in angular can lead to it being replaced by angular classes. Angular also has its own progress bar that uses similar tags. However, elements like the html5 slider do not get ...

Clicking the load more button fails to retrieve any additional content

Recently, I implemented a "load more" button on my website's front page. The idea is for this button to load additional posts after every 15 posts. Despite having all the necessary code in place, clicking the button does not trigger any posts to load. ...

Navigate to a specific moment in an HTML5 audio track by clicking on the progress bar

<html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script> $(document).ready(function(){ var counter = 0; ...

Incorporate a vertical scrollbar in the tbody while keeping the thead fixed for smooth vertical scrolling

I'm seeking a solution to implement horizontal and vertical scroll for my table. Currently, the horizontal scroll is working fine, but when trying to add vertical scroll, the table header also moves along with it. Is there a way to keep the table hea ...

Oops! Looks like the image property is undefined in React and causing a TypeError

Something seems to be going wrong with the Product.js file. This is where I am encountering an error related to finding the ID of the product that is being clicked on from data.js. The issue appears to be in the title section, and I'm struggling to fi ...

Avoid refreshing the page and maintaining the most recent data inputted

On my HTML page, I am trying to implement a button that submits a form using a function. I have set up field validations, and when I click the submit button, it shows an error message but clears out the values I entered and refreshes the form. What I want ...

To navigate to the next page, simply click on the box instead of relying on text links

Here is a piece of code where you can click on the (account) text to open the next page. I am looking to modify this so that clicking on (.box.boxAccounts) will also take you to the next page, not just the text (account). The link_to function provides the ...

Tips for synchronizing JavaScript rendering time with Python requests?

My goal is to retrieve the HTML content of a JavaScript-generated website so that I can extract information using BeautifulSoup. However, when I attempt to request the HTML, the data I receive is from before the page fully loads. Below is the code snippet ...

The buttons are not resizing to fit the entire table cell

I'm currently working with Bootstrap 4 and trying to place buttons in a table cell for each row. However, the buttons are not expanding to fill the available space and appear squished. This issue persists even when I switch to mobile view. From the p ...

The Urdu font is experiencing issues with its right-to-left direction functionality

When displaying Urdu text in an HTML tag (span), the text is supposed to be written from right to left. To achieve this, I added direction:rtl to the CSS styling. However, there seems to be an issue as on the last line, it leaves empty space on the right. ...

Ignoring tags inside a regular expression can be achieved by using the appropriate

Our project utilizes a RegExp to showcase the titles of cards received from the deck. Lately, we have noticed that the deck sometimes sends titles in different formats which are not displaying properly. Previously, the string format was: const res = `&l ...