 		}
 
 		var openTag = ""
-		if !styles.isEmpty {
-			let styleAttributes = "style='\(styles)'"
+		if styles.isEmpty == false {
+            let separator = "; "
+            let styleString = styles.joined(separator: separator) + separator
+			let styleAttributes = "style='\(styleString)'"
 			openTag += self.defaultName.openTag(with: styleAttributes)
 		} else if links.isEmpty {
 			openTag += self.defaultName.openTag()

	func makeOpenTag() -> String {
		guard !self.attributes.isEmpty else { return self.defaultName.openTag() }

		var styles = ""
		var links = ""

		self.attributes.forEach { key, value in
			switch key {
			case .backgroundColor:
				guard let color = value as? Color else { return }

				styles += "background-color: " + self.makeCSSrgba(for: color) + "; "
			case .foregroundColor:
				guard let color = value as? Color else { return }

				styles += "color: " + self.makeCSSrgba(for: color) + "; "
			case .underlineStyle:
				guard let underlineStyle = self.underlineStyle(from: value) else { return }

				styles += "text-decoration: underline; -cocoa-underline: \(underlineStyle); "
			case .underlineColor:
				guard let color = value as? Color else { return }

				styles += "-cocoa-underline-color: " + self.makeCSSrgba(for: color) + "; "
			case .strikethroughColor:
				guard let color = value as? Color else { return }

				styles += "-cocoa-strikethrough-color: " + self.makeCSSrgba(for: color) + "; "
			case .strikethroughStyle:
				guard let underlineStyle = self.underlineStyle(from: value) else { return }

				styles += "text-decoration: line-through; -cocoa-strikethrough: \(underlineStyle); "
			case .font:
				guard let font = value as? Font else { return }

				let fontDescriptor = font.fontDescriptor

				styles += "font: "
                #if os(iOS)
				if fontDescriptor.symbolicTraits.contains(.traitBold) {
					styles += "bold "
				}
				if fontDescriptor.symbolicTraits.contains(.traitItalic) {
					styles += "italic "
				}
                #elseif os(macOS)
                    if fontDescriptor.symbolicTraits.contains(.bold) {
                        styles += "bold "
                    }
                    if fontDescriptor.symbolicTraits.contains(.italic) {
                        styles += "italic "
                    }
                #endif

				styles += String(format: "%gpx ", fontDescriptor.pointSize)
				styles += "\"\(font.cpFamilyName)\"; "

				styles += "-cocoa-font-postscriptname: \"\(fontDescriptor.cpPostscriptName)\"; "

				let uiUsageAttribute = FontDescriptor.AttributeName.init(rawValue: "NSCTFontUIUsageAttribute")
				if let uiUsage = fontDescriptor.fontAttributes[uiUsageAttribute] {
					styles += "; -cocoa-font-uiusage: \"\(uiUsage)\"; "
				}
			case .link:
				guard let url = value as? URL else { return }

		}
	}
}

// MARK: - Array

private extension Array where Element: Hashable {

    mutating func insertFront(_ element: Element) {
        self.insert(element, at: 0)
    }

    mutating func insertBack(_ element: Element) {
        self.append(element)
    }
}
