Combining two CSS files into a single file for a project

I am looking to incorporate the vertical timeline feature from CodyHouse into a project based on a Bootstrap template found at BlackrockDigital. However, when I attempted to integrate them by simply copy/pasting, the styling of the CodyHouse elements did not display correctly. Is there a straightforward solution for achieving this integration smoothly?

Answer №1

I attempted to replicate your issue by integrating the complete vertical timeline demo along with the bootstrap styles.

After analyzing in your web inspector, it was evident that when you include the bootstrap styles before the timeline styles, the order of applied stylesheets for elements like <h2> is: styles.css, then reset.css, and finally the bootstrap CSS:

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://codyhouse.co/demo/vertical-timeline/css/demo.css" rel="stylesheet" />
<link href="https://codyhouse.co/demo/vertical-timeline/css/style.css" rel="stylesheet" />
<link href="https://codyhouse.co/demo/vertical-timeline/css/reset.css" rel="stylesheet" />
<header>
  <div class="cd-nugget-info">
    <a href="https://codyhouse.co/gem/vertical-timeline/">
      <span>
          <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
            <style type="text/css">
              .cd-nugget-info-arrow{fill:#383838;}
            </style>
            <polygon class="cd-nugget-info-arrow" points="15,7 4.4,7 8.4,3 7,1.6 0.6,8 0.6,8 0.6,8 7,14.4 8.4,13 4.4,9 15,9 "/>
          </svg>
        </span> Article &amp; Download
    </a>
  </div>
  <!-- cd-nugget-info -->
  <h1>Responsive Vertical Timeline</h1>
</header>

<section class="cd-timeline js-cd-timeline">
  <div class="cd-timeline__container">
    <div class="cd-timeline__block js-cd-block">
      <div class="cd-timeline__img cd-timeline__img--picture js-cd-img">
        <img src="https://codyhouse.co/demo/vertical-timeline/img/cd-icon-picture.svg" alt="Picture">
      </div>
      <!-- cd-timeline__img -->

      <div class="cd-timeline__content js-cd-content">
        <h2>Title of section 1</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iusto, optio, dolorum provident rerum aut hic quasi placeat iure tempora laudantium ipsa ad debitis unde? Iste voluptatibus minus veritatis qui ut.</p>
        <a href="#0" class="cd-timeline__read-more">Read more</a>
        <span class="cd-timeline__date">Jan 14</span>
      </div>
      <!-- cd-timeline__content -->
    </div>
    <!-- cd-timeline__block -->

    /* Additional sections ommitted for brevity */

  </div>
</section>
<!-- cd-timeline -->

<script src="https://codyhouse.co/demo/vertical-timeline/js/main.js"></script>

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

Unable to import global CSS in React; however, local components are working fine

My React application is having trouble loading global CSS styles. While local components are able to access their own styled-components, the global CSS styles are not being applied across all components. I have tried various import paths and different file ...

Passing a value from the Trigger button to the Modal button in Angular-UI Bootstrap

Seeking some help. I am working with angular-ui-bootstrap alongside php and mysql. My goal is to pass a value from a list of links (dynamically generated from php mysql) to a modal button each time the modal is loaded. HTML // The link below is generated ...

obtain the image number by extracting a portion of the text

How can I extract the image number from a string using the sub-string function? I have applied the sub-string function to the property below. It returns 3 at the end in Chrome, but it does not work properly in Mozilla. Issue : After "-->", when I chec ...

Determining the true width of a span element using jQuery

I am trying to determine the actual width of a span element within a div, but when I attempt to do so, it gives me the width of the entire div instead. Here is the code I am working with: <div class="content"> <span class="type-text" id="ta ...

Padding on a flex item nudges a neighboring flex item out of place

Encountering an issue - within a div container, I have 4 nested divs using the grid system. Oddly enough, the third div in the grid is not behaving as expected. When setting a margin-bottom for this div, instead of creating space at the bottom, it pushes ...

How can I use Java Script to create animation of vertical black bars of a specific width moving across a white background?

Looking for a JavaScript code that can animate vertical black bars of a specific width moving over a white background. The desired outcome is similar to the video found at: https://www.youtube.com/watch?v=bdMWbfTMOMM. Thank you. ...

Display the list items when the page first loads

I currently have this code snippet: <nav> <ul class="sel"> <li> <a href="#LINK1" data-title="A">A</a> </li> <li> <a href ...

Materriel-UI ToggleButton has the appearance of a traditional button

Looking to style a ToggleButton like a button? Having trouble with an error in the console when nesting a button inside? Check out this solution: const StyledToggleButtonGroup = withStyles((theme) => ({ grouped: { margin: theme.spacing(0.5) ...

What is the best way to adjust the width of a column grid header in extjs

When adjusting the width of a vertical header in a grid to 50px, the header text disappears unless manually dragged to the left. How can I ensure the header text remains visible even with a smaller header size? Consider the following code snippet: { text ...

What is the best way to ensure an image is shown in full screen exclusively on mobile devices?

My goal is to have two different site templates, one for desktop (which is already good) and one for mobile. For the mobile template, I want it to display only an image that fills the entire screen. The image should take up all the available space in term ...

What is the best approach to clear floated divs effectively?

Even though I thought I had a grasp on the :after method for clearfixing in CSS, I'm having trouble getting it to work as expected. The siblingContainer that should be clearing after the buttonContainer with floated elements isn't behaving proper ...

When the height of the div is fixed, vertical alignment in the middle won't work as intended

Check out the code snippet below: .fixed-height { height: 100px; background-color: green; } .fixed-height h1 { font-size: 14px; color: red; display: inline; vertical-align: middle; } <div class="fixed-height"> <h1>VERTICAL ALI ...

Creating a Loan Payment Estimator using HTML - A Step-by-Step Guide

I'm in the process of creating a new website with godaddy.com and am struggling to code a calculator for customers to determine their payments. The calculator must include fields for Loan Amount, Loan Length in Months, Interest Rate, and Monthly Payme ...

Optimize your CSS Grid gallery with effective image descriptions and enhanced text management

I have set up a grid gallery on JSFiddle and everything is functioning as expected. I have successfully added descriptions below the images, but encountering issues when attempting to add additional text below the descriptions. When inserting text within t ...

Can the color of an ion-radio be adjusted when it is not selected?

I am experiencing an issue where I need to change the default color (grey) to a specific color of my choice, such as the primary color. I have attempted the following methods: <ion-col sizeXs="12" sizeMd="6" class="radio-box"> <ion-item line ...

Invisible tag remains unseen

I need to dynamically hide some text and show specific labels upon clicking a button. How can I achieve this? <body> <div id="middle"> <div id="left"> </div > <div id="m"> ...

HTML5 header video with a subtle color palette

Is there a way to insert a muted video in the header that spans the full width but only has a height of 300px? The issue I am encountering is that when I decrease the height of the video, the width automatically decreases as well. However, what I want is ...

Troubleshooting: Font-Face Won't Load on Any Browser

I'm completely new to using @font-face and I'm encountering some issues. Despite going through numerous posts and tutorials, I can't seem to get my fonts to load properly. I've tried activating and deactivating the font on the server, b ...

attempting to showcase a set of 4 cards simultaneously within a single carousel interface

I've encountered an issue while trying to create a slider for my card component. Despite several attempts, I'm struggling to display them properly. Adjusting the width of Carousel inner from 100% to 25% resulted in an increased number of pages i ...

CSS Code That Is Ineffective

Having some trouble with creating a hidden background that will still show up but not on the main content page. I'm looking to have a different background for the main content itself, but for some reason it's just not working. The main background ...